mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 04:17:07 +00:00
Fixed Level->getCollidingEntities() when called with a null Entity
This commit is contained in:
parent
de11cce154
commit
35de331b74
@ -1248,7 +1248,7 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
public function getCollidingEntities(AxisAlignedBB $bb, Entity $entity = null){
|
public function getCollidingEntities(AxisAlignedBB $bb, Entity $entity = null){
|
||||||
$nearby = [];
|
$nearby = [];
|
||||||
|
|
||||||
if($entity->canCollide){
|
if($entity === null or $entity->canCollide){
|
||||||
$minX = Math::floorFloat(($bb->minX - 2) / 16);
|
$minX = Math::floorFloat(($bb->minX - 2) / 16);
|
||||||
$maxX = Math::floorFloat(($bb->maxX - 2) / 16);
|
$maxX = Math::floorFloat(($bb->maxX - 2) / 16);
|
||||||
$minZ = Math::floorFloat(($bb->minZ - 2) / 16);
|
$minZ = Math::floorFloat(($bb->minZ - 2) / 16);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user