Skip to content

Commit

Permalink
fixed undefined array key
Browse files Browse the repository at this point in the history
  • Loading branch information
Laith98Dev authored Apr 6, 2022
1 parent b73b028 commit 1671904
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/BedWars/game/GameListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,14 @@ public function onSignChange(SignChangeEvent $event) : void{
}
$pos = $sign->getPosition();
$pos_ = $pos->getX() . ":" . $pos->getY() . ":" . $pos->getZ() . ":" . $player->getWorld()->getFolderName();

foreach ($this->plugin->signs[$text->getLine(1)] as $key => $val){
if($val == $pos_){
return;
}
}

if(isset($this->plugin->signs[$text->getLine(1)])){
foreach ($this->plugin->signs[$text->getLine(1)] as $key => $val){
if($val == $pos_){
return;
}
}
}

$this->plugin->createSign($text->getLine(1), $pos->getX(), $pos->getY(), $pos->getZ(), $player->getWorld()->getFolderName());
$player->sendMessage(BedWars::PREFIX . TextFormat::GREEN . "Sign created");
Expand Down

0 comments on commit 1671904

Please sign in to comment.