mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-13 06:55:29 +00:00
Micro optimization to movement update checking
No need to keep abs()ing this, because next time we have a movement update, motion < 0.00001 will be flattened to zero anyway.
This commit is contained in:
parent
d1852834de
commit
a7674c52e6
@ -1322,9 +1322,9 @@ abstract class Entity extends Location implements Metadatable{
|
|||||||
final public function hasMovementUpdate() : bool{
|
final public function hasMovementUpdate() : bool{
|
||||||
return (
|
return (
|
||||||
$this->forceMovementUpdate or
|
$this->forceMovementUpdate or
|
||||||
abs($this->motionX) > self::MOTION_THRESHOLD or
|
$this->motionX != 0 or
|
||||||
abs($this->motionY) > self::MOTION_THRESHOLD or
|
$this->motionY != 0 or
|
||||||
abs($this->motionZ) > self::MOTION_THRESHOLD or
|
$this->motionZ != 0 or
|
||||||
!$this->onGround
|
!$this->onGround
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user