refine blocked levitation/flight (trunk only)

Levitation side-effects get skipped if Levitation toggles while it
is blocked, so BFlying (the reason Flying is blocked) could become stale
in some situations.  Enlightment feedback about latent flight capability
was the only thing affected.
This commit is contained in:
nethack.rankin
2011-10-22 23:26:17 +00:00
parent 897d527837
commit 282f8e8e70
6 changed files with 35 additions and 18 deletions

View File

@@ -543,6 +543,9 @@ dosinkfall()
off_msg(obj);
}
HLevitation--;
/* probably moot; we're either still levitating or went
through float_down(), but make sure BFlying is up to date */
float_vs_flight();
}
#endif
@@ -1665,9 +1668,7 @@ switch_terrain()
BFlying |= FROMOUTSIDE;
} else if (BFlying) {
BFlying &= ~FROMOUTSIDE;
/* in case BFlying got set due to levitation which then went away
while blocked; there'd be no float_down() with reset of BFlying */
if (!HLevitation && !ELevitation) BFlying &= ~I_SPECIAL;
float_vs_flight(); /* maybe toggle (BFlying & I_SPECIAL) */
/* [minor bug: we don't know whether this is beginning flight or
resuming it; that could be tracked so that this message could
be adjusted to "resume flying", but isn't worth the effort...] */