Fixed Time, Death and more event issues

This commit is contained in:
Shoghi Cervantes Pueyo
2012-12-19 14:23:34 +01:00
parent 11f4096403
commit a833d92d76
6 changed files with 96 additions and 59 deletions

View File

@ -192,10 +192,10 @@ class Entity extends stdClass{
"health" => $this->health,
));
}
if($this->health <= 0){
if($this->health <= 0 and $this->dead === false){
$this->dead = true;
if($this->player !== false){
$this->server->trigger("onPlayerDeath", array("name" => $this->name, "cause" => $cause));
$this->server->handle("onPlayerDeath", array("name" => $this->name, "cause" => $cause));
}
}elseif($this->health > 0){
$this->dead = false;