mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-30 23:29:54 +00:00
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:
parent
9a099d3f5d
commit
611f5d684b
@ -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){
|
||||
|
Loading…
x
Reference in New Issue
Block a user