v2.5.0: fixed specific cases where hero would refuse to move onto traps

This commit is contained in:
Evan Debenham
2024-08-28 11:20:52 -04:00
parent b70870c105
commit f6b00b2839
@@ -1677,7 +1677,8 @@ public class Hero extends Char {
} }
if (walkingToVisibleTrapInFog if (walkingToVisibleTrapInFog
&& Dungeon.level.traps.get(target) != null && Dungeon.level.traps.get(target) != null
&& Dungeon.level.traps.get(target).visible){ && Dungeon.level.traps.get(target).visible
&& Dungeon.level.traps.get(target).active){
return false; return false;
} }
} }
@@ -1778,6 +1779,15 @@ public class Hero extends Char {
Dungeon.level.updateFieldOfView( this, fieldOfView ); Dungeon.level.updateFieldOfView( this, fieldOfView );
} }
if (!Dungeon.level.visited[cell] && !Dungeon.level.mapped[cell]
&& Dungeon.level.traps.get(cell) != null
&& Dungeon.level.traps.get(cell).visible
&& Dungeon.level.traps.get(cell).active) {
walkingToVisibleTrapInFog = true;
} else {
walkingToVisibleTrapInFog = false;
}
Char ch = Actor.findChar( cell ); Char ch = Actor.findChar( cell );
Heap heap = Dungeon.level.heaps.get( cell ); Heap heap = Dungeon.level.heaps.get( cell );
@@ -1837,13 +1847,6 @@ public class Hero extends Char {
} else { } else {
if (!Dungeon.level.visited[cell] && !Dungeon.level.mapped[cell]
&& Dungeon.level.traps.get(cell) != null && Dungeon.level.traps.get(cell).visible) {
walkingToVisibleTrapInFog = true;
} else {
walkingToVisibleTrapInFog = false;
}
curAction = new HeroAction.Move( cell ); curAction = new HeroAction.Move( cell );
lastAction = null; lastAction = null;