mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-06 03:47:16 +00:00
Drowing is only checked once per check
This commit is contained in:
parent
6a29dd5a8d
commit
70b86061f6
@ -238,6 +238,7 @@ class Entity extends stdClass{
|
||||
$endX = $startX + 2;
|
||||
$endY = $startY + 2;
|
||||
$endZ = $startZ + 2;
|
||||
$waterDone = false;
|
||||
for($y = $startY; $y <= $endY; ++$y){
|
||||
for($x = $startX; $x <= $endX; ++$x){
|
||||
for($z = $startZ; $z <= $endZ; ++$z){
|
||||
@ -251,8 +252,9 @@ class Entity extends stdClass{
|
||||
}
|
||||
if($this->air <= 0){
|
||||
$this->harm(2, "water");
|
||||
}elseif($x == ($endX - 1) and $y == $endY and $z == ($endZ - 1) and ($this->class === ENTITY_MOB or $this->class === ENTITY_PLAYER)){
|
||||
}elseif($x == ($endX - 1) and $y == $endY and $z == ($endZ - 1) and ($this->class === ENTITY_MOB or $this->class === ENTITY_PLAYER) and $waterDone === false){
|
||||
$this->air -= 10;
|
||||
$waterDone = true;
|
||||
$this->updateMetadata();
|
||||
}
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user