mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 08:44:01 +00:00
Entity: Fixed logic error in getBlocksAround() which caused yet another firebug
Try setting a fire at z = -204, then stand on the edge between -205 and -206. The coordinates that a BB's corners are encapsulated in are always the floor()ed coordinates If you stand at -205.0, your BB min is -205.3 and your BB max is -204.7, which then incorrectly tells you that the BB intersects with block -204 because ceil(-204.7) == -204 when you actually are only intersecting with -205 and -206 this is as bad as using (int) to floor integers :kms:
This commit is contained in:
parent
a4f5cab12d
commit
65fe19ca71
@ -1665,9 +1665,9 @@ abstract class Entity extends Location implements Metadatable, EntityIds{
|
||||
$minX = Math::floorFloat($this->boundingBox->minX + $inset);
|
||||
$minY = Math::floorFloat($this->boundingBox->minY + $inset);
|
||||
$minZ = Math::floorFloat($this->boundingBox->minZ + $inset);
|
||||
$maxX = Math::ceilFloat($this->boundingBox->maxX - $inset);
|
||||
$maxY = Math::ceilFloat($this->boundingBox->maxY - $inset);
|
||||
$maxZ = Math::ceilFloat($this->boundingBox->maxZ - $inset);
|
||||
$maxX = Math::floorFloat($this->boundingBox->maxX - $inset);
|
||||
$maxY = Math::floorFloat($this->boundingBox->maxY - $inset);
|
||||
$maxZ = Math::floorFloat($this->boundingBox->maxZ - $inset);
|
||||
|
||||
$this->blocksAround = [];
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user