added Entity::setHealth() force

This commit is contained in:
Shoghi Cervantes 2013-12-03 22:25:25 +01:00
parent 2b28e26392
commit 3cffa66490

View File

@ -956,7 +956,7 @@ class Entity extends Position{
}elseif($health === $this->health){
return false;
}
if($this->server->api->dhandle("entity.health.change", array("entity" => $this, "eid" => $this->eid, "health" => $health, "cause" => $cause)) !== false){
if($this->server->api->dhandle("entity.health.change", array("entity" => $this, "eid" => $this->eid, "health" => $health, "cause" => $cause)) !== false or $force === true){
$this->health = min(127, max(-127, $health));
$this->server->query("UPDATE entities SET health = ".$this->health." WHERE EID = ".$this->eid.";");
if($harm === true){