wizard mode wishing for terrain

Changing terrain type without moving wasn't registering as moving to
different terrain.  A Passes_walls hero who has levitation blocked
while moving through solid rock can wish for furniture.  Levitation
remained blocked unless hero moved off that spot and then back on.

Doesn't affect normal play.  Changing terrain by digging already
deals with similar situation; not sure whether there are any other
situations that might need to handle it.
This commit is contained in:
PatR
2020-04-04 03:29:40 -07:00
parent c8044a202b
commit 8119c52d84

View File

@@ -3116,6 +3116,7 @@ int locked, trapped;
if (madeterrain) {
feel_newsym(x, y); /* map the spot where the wish occurred */
/* hero started at <x,y> but might not be there anymore (create
lava, decline to die, and get teleported away to safety) */
if (u.uinwater && !is_pool(u.ux, u.uy)) {
@@ -3134,6 +3135,7 @@ int locked, trapped;
unblock_point(x, y);
}
}
/* fixups for replaced terrain that aren't handled above;
for fountain placed on fountain or sink placed on sink, the
increment above gets canceled out by the decrement here;
@@ -3156,6 +3158,11 @@ int locked, trapped;
}
/* note: lev->lit and lev->nondiggable retain their values even
though those might not make sense with the new terrain */
/* might have changed terrain from something that blocked
levitation and flying to something that doesn't (levitating
while in xorn form and replacing solid stone with furniture) */
switch_terrain();
}
if (madeterrain || badterrain) {
/* cast 'const' away; caller won't modify this */