fix #K3857 - hiding while trapped in a non-pit

sanity_check feedback which occurred after using locking magic to
set off a bear trap at the location of a monster hiding under an
object.

Trivial bit: a recent change made stunning via knockback only occur
when not already stunned but was still adding the current stun time
to the new stun time even though current stun is now always zero.

Several formatting bits included.
This commit is contained in:
PatR
2023-02-03 10:45:59 -08:00
parent 9931d05fc2
commit 3e6ea3faed
3 changed files with 30 additions and 17 deletions

View File

@@ -4884,7 +4884,7 @@ mhitm_knockback(
set_apparxy(magr); /* update magr's idea of where you are */
if (!Stunned && !rn2(4))
make_stunned((HStun & TIMEOUT) + (long) rnd(2) + 1L, TRUE);
make_stunned((long) rn1(2, 2), TRUE); /* 0..1 + 2 => 2..3 */
} else {
coordxy x = u_agr ? u.ux : magr->mx;
coordxy y = u_agr ? u.uy : magr->my;