mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-11 22:15:30 +00:00
Added exception throws when a closed tile or entity attempts to schedule itself for updating
I can't believe it took so long to find what was causing these stdClass bugs.
This commit is contained in:
parent
fdd5b7b9c9
commit
14914781fc
@ -1377,6 +1377,9 @@ abstract class Entity extends Location implements Metadatable, EntityIds{
|
|||||||
}
|
}
|
||||||
|
|
||||||
final public function scheduleUpdate() : void{
|
final public function scheduleUpdate() : void{
|
||||||
|
if($this->closed){
|
||||||
|
throw new \InvalidStateException("Cannot schedule update on garbage entity " . get_class($this));
|
||||||
|
}
|
||||||
$this->level->updateEntities[$this->id] = $this;
|
$this->level->updateEntities[$this->id] = $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -254,6 +254,9 @@ abstract class Tile extends Position{
|
|||||||
}
|
}
|
||||||
|
|
||||||
final public function scheduleUpdate() : void{
|
final public function scheduleUpdate() : void{
|
||||||
|
if($this->closed){
|
||||||
|
throw new \InvalidStateException("Cannot schedule update on garbage tile " . get_class($this));
|
||||||
|
}
|
||||||
$this->level->updateTiles[$this->id] = $this;
|
$this->level->updateTiles[$this->id] = $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user