Skip to content

Commit

Permalink
autopickup during failed #untrap attempt (trunk only)
Browse files Browse the repository at this point in the history
     From a bug report, moving into a trap
during a failed untrap attempt didn't autopickup any objects there or
report about objects which aren't picked up.  Although that appears to have
been intentional, change move_into_trap() to behave more like a regular
move.  (I wrote this bit of code and don't remember whether the no pickup
aspect was deliberate; I suspect it might have been to avoid the redundant
"there is a trap here" message which you get when pickup checking is done
but not everything on the spot gets picked up.  This patch suppresses that
message.)
  • Loading branch information
nethack.rankin committed Apr 6, 2006
1 parent 2c0a072 commit 820f3f7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 2 additions & 0 deletions doc/fixes35.0
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ better handling for Fort Ludios and endgame in wizard mode's `^V ?' menu
no free lunch for gelatinous cubes eating scrolls of mail
eating gold in front of the vault guard will make the guard angry
calculate engulf time differently for non-digestion attacks than for digestion
preform autopickup and/or report on objects at the spot when a failed #untrap
attempt causes the hero to move onto a trap's location


Platform- and/or Interface-Specific Fixes
Expand Down
14 changes: 10 additions & 4 deletions src/trap.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* SCCS Id: @(#)trap.c 3.5 2005/12/05 */
/* SCCS Id: @(#)trap.c 3.5 2006/04/05 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */

Expand Down Expand Up @@ -3235,16 +3235,22 @@ struct trap *ttmp;
boolean unused;

/* we know there's no monster in the way, and we're not trapped */
if (!Punished || drag_ball(x, y, &bc, &bx, &by, &cx, &cy, &unused,
TRUE)) {
if (!Punished ||
drag_ball(x, y, &bc, &bx, &by, &cx, &cy, &unused, TRUE)) {
u.ux0 = u.ux, u.uy0 = u.uy;
u.ux = x, u.uy = y;
u.umoved = TRUE;
newsym(u.ux0, u.uy0);
vision_recalc(1);
check_leash(u.ux0, u.uy0);
if (Punished) move_bc(0, bc, bx, by, cx, cy);
spoteffects(FALSE); /* dotrap() */
/* marking the trap unseen forces dotrap() to treat it like a new
discovery and prevents pickup() -> look_here() -> check_here()
from giving a redudant "there is a <trap> here" message when
there are objects covering this trap */
ttmp->tseen = 0; /* hack for check_here() */
/* trigger the trap */
spoteffects(TRUE); /* pickup() + dotrap() */
exercise(A_WIS, FALSE);
}
}
Expand Down

0 comments on commit 820f3f7

Please sign in to comment.