#ride workaround

From the newsgroup:
> Apparent bug or weird-seeming feature:
> If you try to mount a horse that is already in a pit,
> you get the message "You lead the poor <foo> into a pit!"

     I checked into fixing this properly (you mount the steed and
then shared its trapped status without actively retriggering the
trap in the process), but the trap code is too convoluted to do
that cleanly.  So this "fix" just makes mounting attempts fail if
the steed is trapped.

     (This diff is mostly whitespace cleanup.)
This commit is contained in:
nethack.rankin
2002-05-10 01:50:22 +00:00
parent e6f9748511
commit 847b037d58
2 changed files with 24 additions and 15 deletions
+1
View File
@@ -98,6 +98,7 @@ don't claim that statue comes to life if the monster it turns into is invisible
fix goodpos() so worm segments don't get placed on top of each other (causing fix goodpos() so worm segments don't get placed on top of each other (causing
a possible display problem if the worm is cut in two) a possible display problem if the worm is cut in two)
fix fountain noises on some special levels (castle, valk home, various mines) fix fountain noises on some special levels (castle, valk home, various mines)
disallow mounting a trapped steed to avoid inappropriate trap effects
Platform- and/or Interface-Specific Fixes Platform- and/or Interface-Specific Fixes
+11 -3
View File
@@ -1,4 +1,4 @@
/* SCCS Id: @(#)steed.c 3.4 2002/03/09 */ /* SCCS Id: @(#)steed.c 3.4 2002/05/05 */
/* Copyright (c) Kevin Hugo, 1998-1999. */ /* Copyright (c) Kevin Hugo, 1998-1999. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -236,8 +236,7 @@ mount_steed(mtmp, force)
if (u.uswallow || u.ustuck || u.utrap || Punished) { if (u.uswallow || u.ustuck || u.utrap || Punished) {
if (!force) { if (!force) {
if (Punished) if (Punished)
You("are unable to swing your %s over.", You("are unable to swing your %s over.", body_part(LEG));
body_part(LEG));
else else
You("are stuck here for now."); You("are stuck here for now.");
} }
@@ -271,6 +270,15 @@ mount_steed(mtmp, force)
pline("I think %s would mind.", mon_nam(mtmp)); pline("I think %s would mind.", mon_nam(mtmp));
return (FALSE); return (FALSE);
} }
if (mtmp->mtrapped) {
struct trap *t = t_at(mtmp->mx, mtmp->my);
You_cant("mount %s while %s's trapped in %s.",
mon_nam(mtmp), mhe(mtmp),
an(defsyms[trap_to_defsym(t->ttyp)].explanation));
return (FALSE);
}
if (!force && !Role_if(PM_KNIGHT) && !(--mtmp->mtame)) { if (!force && !Role_if(PM_KNIGHT) && !(--mtmp->mtame)) {
/* no longer tame */ /* no longer tame */
newsym(mtmp->mx, mtmp->my); newsym(mtmp->mx, mtmp->my);