-NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.280 $ $NHDT-Date: 1597069374 2020/08/10 14:22:54 $
+NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.281 $ $NHDT-Date: 1597090815 2020/08/10 20:20:15 $
General Fixes and Modified Features
-----------------------------------
chatting to the quest leader in wizard mode with sufficient experience level
and insufficient piety, player is asked whether alignment should be
boosted; answering 'n' resulted in being prompted a second time
+leashing or unleashing pets wasn't updating persistent inventory window
Fixes to 3.7.0-x Problems that Were Exposed Via git Repository
-/* NetHack 3.7 apply.c $NHDT-Date: 1596498148 2020/08/03 23:42:28 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.326 $ */
+/* NetHack 3.7 apply.c $NHDT-Date: 1597090815 2020/08/10 20:20:15 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.327 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
/* otmp is about to be destroyed or stolen */
void
o_unleash(otmp)
-register struct obj *otmp;
+struct obj *otmp;
{
register struct monst *mtmp;
for (mtmp = fmon; mtmp; mtmp = mtmp->nmon)
- if (mtmp->m_id == (unsigned) otmp->leashmon)
+ if (mtmp->m_id == (unsigned) otmp->leashmon) {
mtmp->mleashed = 0;
- otmp->leashmon = 0;
+ otmp->leashmon = 0;
+ update_inventory();
+ break;
+ }
}
/* mtmp is about to die, or become untame */
void
m_unleash(mtmp, feedback)
-register struct monst *mtmp;
+struct monst *mtmp;
boolean feedback;
{
register struct obj *otmp;
Your("leash falls slack.");
}
for (otmp = g.invent; otmp; otmp = otmp->nobj)
- if (otmp->otyp == LEASH && otmp->leashmon == (int) mtmp->m_id)
+ if (otmp->otyp == LEASH && (unsigned) otmp->leashmon == mtmp->m_id) {
otmp->leashmon = 0;
+ update_inventory();
+ break;
+ }
mtmp->mleashed = 0;
}
mtmp->mleashed = 1;
obj->leashmon = (int) mtmp->m_id;
mtmp->msleeping = 0;
+ update_inventory();
}
} else {
/* applying a leash which is currently in use */
} else {
mtmp->mleashed = 0;
obj->leashmon = 0;
+ update_inventory();
You("remove the leash from %s%s.",
spotmon ? "your " : "", l_monnam(mtmp));
}
{
struct obj *otmp;
- otmp = g.invent;
- while (otmp) {
- if (otmp->otyp == LEASH && otmp->leashmon == (int) mtmp->m_id)
- return otmp;
- otmp = otmp->nobj;
- }
- return (struct obj *) 0;
+ for (otmp = g.invent; otmp; otmp = otmp->nobj)
+ if (otmp->otyp == LEASH && (unsigned) otmp->leashmon == mtmp->m_id)
+ break;
+ return otmp;
}
boolean
if (distu(mtmp->mx, mtmp->my) > 2) {
for (otmp = g.invent; otmp; otmp = otmp->nobj)
if (otmp->otyp == LEASH
- && otmp->leashmon == (int) mtmp->m_id) {
+ && (unsigned) otmp->leashmon == mtmp->m_id) {
if (otmp->cursed)
return FALSE;
- You_feel("%s leash go slack.",
- (number_leashed() > 1) ? "a" : "the");
mtmp->mleashed = 0;
otmp->leashmon = 0;
+ update_inventory();
+ You_feel("%s leash go slack.",
+ (number_leashed() > 1) ? "a" : "the");
}
}
}