mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 08:44:01 +00:00
Entity: avoid astonishing behaviour with motion vector modifications
This commit is contained in:
parent
3a1df1d99e
commit
c18ba38b74
@ -1121,7 +1121,7 @@ abstract class Entity extends Location implements Metadatable, EntityIds{
|
||||
$this->broadcastMovement($teleport);
|
||||
}
|
||||
|
||||
if($diffMotion > 0.0025 or ($diffMotion > 0.0001 and $this->getMotion()->lengthSquared() <= 0.0001)){ //0.05 ** 2
|
||||
if($diffMotion > 0.0025 or ($diffMotion > 0.0001 and $this->motion->lengthSquared() <= 0.0001)){ //0.05 ** 2
|
||||
$this->lastMotion = clone $this->motion;
|
||||
|
||||
$this->broadcastMotion();
|
||||
@ -1812,7 +1812,7 @@ abstract class Entity extends Location implements Metadatable, EntityIds{
|
||||
}
|
||||
|
||||
public function getMotion() : Vector3{
|
||||
return $this->motion;
|
||||
return clone $this->motion;
|
||||
}
|
||||
|
||||
public function setMotion(Vector3 $motion) : bool{
|
||||
|
Loading…
x
Reference in New Issue
Block a user