Player: removed redundant isFirst check for movement

Since the addition of resetLastMovements(), this code is useless.

Additionally, it doesn't make sense to ignore the first movement, because the first movement still _moves the player_ from point A to point B.
This commit is contained in:
Dylan K. Taylor 2018-03-24 10:40:30 +00:00
parent 9a099d3f5d
commit 611f5d684b

View File

@ -1594,9 +1594,6 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
$deltaAngle = abs($this->lastYaw - $to->yaw) + abs($this->lastPitch - $to->pitch);
if(!$revert and ($delta > 0.0001 or $deltaAngle > 1.0)){
$isFirst = ($this->lastX === null or $this->lastY === null or $this->lastZ === null);
$this->lastX = $to->x;
$this->lastY = $to->y;
$this->lastZ = $to->z;
@ -1604,7 +1601,6 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
$this->lastYaw = $to->yaw;
$this->lastPitch = $to->pitch;
if(!$isFirst){
$ev = new PlayerMoveEvent($this, $from, $to);
$this->server->getPluginManager()->callEvent($ev);
@ -1624,7 +1620,6 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
}
}
}
}
$this->speed = $to->subtract($from)->divide($tickDiff);
}elseif($distanceSquared == 0){