mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-14 22:01:59 +00:00
Fixed random suffocation
This commit is contained in:
parent
828b794555
commit
36fdb10b9e
@ -123,7 +123,7 @@ class Entity extends stdClass{
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if($this->inBlock($x, $y, $z) and !isset(Material::$transparent[$b[0]])){
|
if($this->inBlock($x, $y, $z, 0.7) and !isset(Material::$transparent[$b[0]])){
|
||||||
$this->harm(1, "suffocation"); //Suffocation
|
$this->harm(1, "suffocation"); //Suffocation
|
||||||
}elseif($x == ($endX - 1) and $y == $endY and $z == ($endZ - 1)){
|
}elseif($x == ($endX - 1) and $y == $endY and $z == ($endZ - 1)){
|
||||||
$this->air = 300; //Breathing
|
$this->air = 300; //Breathing
|
||||||
@ -333,7 +333,7 @@ class Entity extends stdClass{
|
|||||||
$health = (int) $health;
|
$health = (int) $health;
|
||||||
if($health < $this->health){
|
if($health < $this->health){
|
||||||
$dmg = $this->health - $health;
|
$dmg = $this->health - $health;
|
||||||
if(($this->gamemode === 0 or $force === true) and ($this->dmgcounter[0] < microtime(true) or $this->dmgcounter[1] < $dmg) and !$this->dead){
|
if(($this->server->gamemode === 0 or $force === true) and ($this->dmgcounter[0] < microtime(true) or $this->dmgcounter[1] < $dmg) and !$this->dead){
|
||||||
$this->dmgcounter = array(microtime(true) + 0.5, $dmg);
|
$this->dmgcounter = array(microtime(true) + 0.5, $dmg);
|
||||||
}else{
|
}else{
|
||||||
return false; //Entity inmunity
|
return false; //Entity inmunity
|
||||||
|
Loading…
x
Reference in New Issue
Block a user