Fix a NullPointerException in InteractionBattleBanzaiPuck

This commit is contained in:
Alejandro 2019-05-18 18:40:45 +03:00
parent be7fc16935
commit 0fbebc5ac8

View File

@ -140,8 +140,10 @@ public class InteractionBattleBanzaiPuck extends InteractionPushable
@Override
public boolean validMove(Room room, RoomTile from, RoomTile to)
{
if (room == null || from == null || to == null) return false;
HabboItem topItem = room.getTopItemAt(to.x, to.y, this);
return topItem instanceof InteractionBattleBanzaiTile;
return topItem != null && topItem instanceof InteractionBattleBanzaiTile;
//return !(!room.getLayout().tileWalkable(to.x, to.y) || (topItem != null && (!topItem.getBaseItem().setAllowStack() || topItem.getBaseItem().allowSit() || topItem.getBaseItem().allowLay())));
}