farmland weird loop is gone

This commit is contained in:
GameHerobrine 2022-12-12 13:54:37 +03:00
parent 019e7f26ea
commit 569f81c70c
3 changed files with 32 additions and 70 deletions

View file

@ -103,7 +103,7 @@ class EntityAPI{
if($args[0] === "all"){
$cnt = 0;
foreach($this->entities as $e){
if(!$e->isPlayer()){ //if player, not despawning
if(isset($e) && $e != null && !$e->isPlayer()){ //if player, not despawning
$this->remove($e->eid);
$cnt++;
}
@ -292,4 +292,4 @@ class EntityAPI{
}
return $this->entities;
}
}
}