diff --git a/doc/fixes35.0 b/doc/fixes35.0 index a90bfd2b7..1648c5f2a 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -170,6 +170,7 @@ for inventory display, include cost info on hero-owned containers holding shop goods shops now claim ownership of items created by using an unpaid horn of plenty shopkeepers shouldn't refer to non-male character as "cad" +tweak levitation timeout if trap is being triggered on same turn it is to end Platform- and/or Interface-Specific Fixes diff --git a/src/hack.c b/src/hack.c index 826be5e06..010abee8c 100644 --- a/src/hack.c +++ b/src/hack.c @@ -1638,6 +1638,22 @@ stillinwater:; if (!in_steed_dismounting) { /* if dismounting, we'll check again later */ boolean pit; + /* if levitation is due to time out at the end of this + turn, allowing it to do so could give the perception + that a trap here is being triggered twice, so adjust + the timeout to prevent that */ + if (trap && (HLevitation & TIMEOUT) == 1L) { + if (rn2(2)) { /* defer timeout */ + HLevitation += 1L; + } else { /* timeout early */ + if (float_down(I_SPECIAL|TIMEOUT, 0L)) { + /* levitation has ended; we've already triggered + any trap and [usually] performed autopickup */ + trap = 0; + pick = FALSE; + } + } + } /* * If not a pit, pickup before triggering trap. * If pit, trigger trap before pickup.