Added next step height checking in RoomUnit cycle - Closes #858

This commit is contained in:
Beny 2020-10-16 06:04:31 +02:00
parent 90918309b7
commit 16d2ba85ae

View File

@ -243,7 +243,8 @@ public class RoomUnit {
//if(!(this.path.size() == 0 && canSitNextTile))
{
if (!room.tileWalkable(next)) {
double height = next.getStackHeight() - this.currentLocation.getStackHeight();
if (!room.tileWalkable(next) || (!RoomLayout.ALLOW_FALLING && height < -RoomLayout.MAXIMUM_STEP_HEIGHT) || (next.state == RoomTileState.OPEN && height > RoomLayout.MAXIMUM_STEP_HEIGHT)) {
this.room = room;
this.path.clear();
this.findPath();