Entity: avoid bad hack on high load which causes bugs on entity move

This commit is contained in:
Dylan K. Taylor 2019-08-13 18:08:56 +01:00
parent 47b905007e
commit e9ed46a9c7

View File

@ -1252,8 +1252,7 @@ abstract class Entity extends Location{
assert(abs($dx) <= 20 and abs($dy) <= 20 and abs($dz) <= 20, "Movement distance is excessive: dx=$dx, dy=$dy, dz=$dz");
//TODO: bad hack here will cause unexpected behaviour under heavy lag
$list = $this->world->getCollisionBoxes($this, $this->world->getTickRateTime() > 50 ? $this->boundingBox->offsetCopy($dx, $dy, $dz) : $this->boundingBox->addCoord($dx, $dy, $dz), false);
$list = $this->world->getCollisionBoxes($this, $this->boundingBox->addCoord($dx, $dy, $dz), false);
foreach($list as $bb){
$dy = $bb->calculateYOffset($this->boundingBox, $dy);