From 384628da9aece37933d89bd3d86e63a8159fdc14 Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Sat, 27 Nov 2004 03:06:21 +0000 Subject: [PATCH] fix steed eating feedback reported that riding a steed into a magic portal can give "steed is still eating" message, feedback normally used to explain why you can't go down stairs. Rather than preventing portals from activating in that situation, just force the meal to be finished in order to suppress the message. Proper fix is probably to prevent all steed movement while eating, but that would most likely result in no one ever riding again. --- doc/fixes34.4 | 1 + src/dog.c | 26 ++++++++++++++++++++++---- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/doc/fixes34.4 b/doc/fixes34.4 index b08cd61da..7032184b5 100644 --- a/doc/fixes34.4 +++ b/doc/fixes34.4 @@ -67,6 +67,7 @@ helmets don't protect against cockatrice eggs thrown straight up breaking container contents in a shop didn't always charge for them some types of shop theft of a stack of items only charged for a single one wizard mode: WIZKIT wish for own quest artifact triggered crash at startup +avoid "your steed is still eating" message when going through a magic portal Platform- and/or Interface-Specific Fixes diff --git a/src/dog.c b/src/dog.c index a6a94d433..d77be238d 100644 --- a/src/dog.c +++ b/src/dog.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)dog.c 3.4 2004/06/12 */ +/* SCCS Id: @(#)dog.c 3.4 2004/11/26 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -507,6 +507,19 @@ boolean pets_only; /* true for ascension or final escape */ /* monster won't follow if it hasn't noticed you yet */ && !(mtmp->mstrategy & STRAT_WAITFORU)) { stay_behind = FALSE; +#ifdef STEED + if (mtmp == u.usteed) { + /* make sure steed is eligible to accompany hero; + start by having mintrap() give a chance to escape + trap normally but if that fails, force the untrap + (note: handle traps first because normal escape + has the potential to set monster->meating) */ + if (mtmp->mtrapped && mintrap(mtmp)) + mtmp->mtrapped = 0; /* escape trap */ + mtmp->meating = 0; /* terminate eating */ + mdrop_special_objs(mtmp); /* drop Amulet */ + } else +#endif if (mtmp->mtame && mtmp->meating) { if (canseemon(mtmp)) pline("%s is still eating.", Monnam(mtmp)); @@ -521,9 +534,6 @@ boolean pets_only; /* true for ascension or final escape */ pline("%s is still trapped.", Monnam(mtmp)); stay_behind = TRUE; } -#ifdef STEED - if (mtmp == u.usteed) stay_behind = FALSE; -#endif if (stay_behind) { if (mtmp->mleashed) { pline("%s leash suddenly comes loose.", @@ -532,6 +542,14 @@ boolean pets_only; /* true for ascension or final escape */ : "Its"); m_unleash(mtmp, FALSE); } +#ifdef STEED + if (mtmp == u.usteed) { + /* can't happen unless someone makes a change + which scrambles the stay_behind logic above */ + impossible("steed left behind?"); + dismount_steed(DISMOUNT_GENERIC); + } +#endif continue; } if (mtmp->isshk) -- 2.40.0