From 7388a32869ac31d20229071254b304994f1373d9 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Pueyo Date: Fri, 12 Apr 2013 14:04:57 +0200 Subject: [PATCH] Fixed flying check support range --- src/world/Entity.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/world/Entity.php b/src/world/Entity.php index d0ed74db..818dc5a6 100644 --- a/src/world/Entity.php +++ b/src/world/Entity.php @@ -310,8 +310,8 @@ class Entity extends stdClass{ $endX = $startX + 2; $endZ = $startZ + 2; $support = false; - for($z = $startZ; $z < $endZ; ++$z){ - for($x = $startX; $x < $endX; ++$x){ + for($z = $startZ; $z <= $endZ; ++$z){ + for($x = $startX; $x <= $endX; ++$x){ $v = new Vector3($x, $y, $z); if($this->isSupport($v)){ $b = $this->server->api->block->getBlock($v); @@ -345,13 +345,14 @@ class Entity extends stdClass{ $this->speedZ = 0; //$this->server->api->handle("entity.motion", $this); } - }else{ - if($support === false){ + }elseif($this->class === ENTITY_PLAYER){ + if($support === false and $this->player->gamemode !== CREATIVE){ + console("flying!"); if($this->fallY === false or $this->fallStart === false){ $this->fallY = $y; $this->fallStart = microtime(true); }elseif($this->class === ENTITY_PLAYER and ($this->fallStart + 5) < microtime(true)){ - if($this->player->gamemode !== CREATIVE and $this->server->api->getProperty("allow-flight") !== true and $this->server->handle("player.flying", $this->player) !== true){ + if($this->server->api->getProperty("allow-flight") !== true and $this->server->handle("player.flying", $this->player) !== true){ $this->player->close("flying"); return; }