message sequencing when vampire shifts to fog cloud to pass under closed door:
when in sight, give form change message before moving to door spot
limit carrying heavy loads from water to land
+failing to carry a wished-for item behaved differenctly from dropping one
Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository
-/* NetHack 3.6 extern.h $NHDT-Date: 1545383614 2018/12/21 09:13:34 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.675 $ */
+/* NetHack 3.6 extern.h $NHDT-Date: 1545597403 2018/12/23 20:36:43 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.676 $ */
/* Copyright (c) Steve Creps, 1988. */
/* NetHack may be freely redistributed. See license for details. */
E int NDECL(dothrow);
E int NDECL(dofire);
E void FDECL(endmultishot, (BOOLEAN_P));
-E void FDECL(hitfloor, (struct obj *));
+E void FDECL(hitfloor, (struct obj *, BOOLEAN_P));
E void FDECL(hurtle, (int, int, int, BOOLEAN_P));
E void FDECL(mhurtle, (struct monst *, int, int, int));
E boolean FDECL(throwing_weapon, (struct obj *));
-/* NetHack 3.6 artifact.c $NHDT-Date: 1543745353 2018/12/02 10:09:13 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.127 $ */
+/* NetHack 3.6 artifact.c $NHDT-Date: 1545597414 2018/12/23 20:36:54 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.128 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2013. */
/* NetHack may be freely redistributed. See license for details. */
}
case ENERGY_BOOST: {
int epboost = (u.uenmax + 1 - u.uen) / 2;
+
if (epboost > 120)
epboost = 120; /* arbitrary */
else if (epboost < 12)
otmp->owt = weight(otmp);
otmp = hold_another_object(otmp, "Suddenly %s out.",
aobjnam(otmp, "fall"), (char *) 0);
+ nhUse(otmp);
break;
}
}
}
if ((eprop & ~W_ARTI) || iprop) {
- nothing_special:
+ nothing_special:
/* you had the property from some other source too */
if (carried(obj))
You_feel("a surge of power, but nothing seems to happen.");
if (loseit && obj) {
if (Levitation) {
freeinv(obj);
- hitfloor(obj);
+ hitfloor(obj, TRUE);
} else {
/* dropx gives a message iff item lands on an altar */
if (!IS_ALTAR(levl[u.ux][u.uy].typ))
-/* NetHack 3.6 do.c $NHDT-Date: 1545043771 2018/12/17 10:49:31 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.181 $ */
+/* NetHack 3.6 do.c $NHDT-Date: 1545597418 2018/12/23 20:36:58 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.182 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Derek S. Ray, 2015. */
/* NetHack may be freely redistributed. See license for details. */
if (obj->oclass == COIN_CLASS)
context.botl = 1;
freeinv(obj);
- hitfloor(obj);
+ hitfloor(obj, TRUE);
if (levhack)
float_down(I_SPECIAL | TIMEOUT, W_ARTI | W_ART);
return 1;
-/* NetHack 3.6 dothrow.c $NHDT-Date: 1545044705 2018/12/17 11:05:05 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.154 $ */
+/* NetHack 3.6 dothrow.c $NHDT-Date: 1545597420 2018/12/23 20:37:00 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.155 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2013. */
/* NetHack may be freely redistributed. See license for details. */
}
}
-/*
- * Object hits floor at hero's feet. Called from drop() and throwit().
- */
+/* Object hits floor at hero's feet.
+ Called from drop(), throwit(), hold_another_object(). */
void
-hitfloor(obj)
-register struct obj *obj;
+hitfloor(obj, verbosely)
+struct obj *obj;
+boolean verbosely; /* usually True; False if caller has given drop message */
{
- if (IS_SOFT(levl[u.ux][u.uy].typ) || u.uinwater) {
+ if (IS_SOFT(levl[u.ux][u.uy].typ) || u.uinwater || u.uswallow) {
dropy(obj);
return;
}
if (IS_ALTAR(levl[u.ux][u.uy].typ))
doaltarobj(obj);
- else
- pline("%s hit%s the %s.", Doname2(obj), (obj->quan == 1L) ? "s" : "",
+ else if (verbosely)
+ pline("%s %s the %s.", Doname2(obj), otense(obj, "hit"),
surface(u.ux, u.uy));
if (hero_breaks(obj, u.ux, u.uy, TRUE))
done(STONING);
return obj ? TRUE : FALSE;
}
- hitfloor(obj);
+ hitfloor(obj, TRUE);
thrownobj = 0;
losehp(Maybe_Half_Phys(dmg), "falling object", KILLED_BY_AN);
}
for dealing with cursed saddle: throw holy water > */
potionhit(u.usteed, obj, POTHIT_HERO_THROW);
} else {
- hitfloor(obj);
+ hitfloor(obj, TRUE);
}
thrownobj = (struct obj *) 0;
return;
-/* NetHack 3.6 invent.c $NHDT-Date: 1545043772 2018/12/17 10:49:32 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.244 $ */
+/* NetHack 3.6 invent.c $NHDT-Date: 1545597422 2018/12/23 20:37:02 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.245 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Derek S. Ray, 2015. */
/* NetHack may be freely redistributed. See license for details. */
}
}
if (Fumbling) {
- if (drop_fmt)
- pline(drop_fmt, drop_arg);
- dropy(obj);
+ obj->nomerge = 1;
+ obj = addinv(obj); /* dropping expects obj to be in invent */
+ goto drop_it;
} else {
long oquan = obj->quan;
int prev_encumbr = near_capacity(); /* before addinv() */
obj = addinv(obj);
if (inv_cnt(FALSE) > 52 || ((obj->otyp != LOADSTONE || !obj->cursed)
&& near_capacity() > prev_encumbr)) {
- if (drop_fmt)
- pline(drop_fmt, drop_arg);
/* undo any merge which took place */
if (obj->quan > oquan)
obj = splitobj(obj, oquan);
- dropx(obj);
+ goto drop_it;
} else {
if (flags.autoquiver && !uquiver && !obj->owornmask
&& (is_missile(obj) || ammo_and_launcher(obj, uwep)
}
}
return obj;
+
+ drop_it:
+ if (drop_fmt)
+ pline(drop_fmt, drop_arg);
+ obj->nomerge = 0;
+ if (can_reach_floor(TRUE)) {
+ dropx(obj);
+ } else {
+ freeinv(obj);
+ hitfloor(obj, FALSE);
+ }
+ return (struct obj *) 0; /* might be gone */
}
/* useup() all of an item regardless of its quantity */
-/* NetHack 3.6 mail.c $NHDT-Date: 1542765359 2018/11/21 01:55:59 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.37 $ */
+/* NetHack 3.6 mail.c $NHDT-Date: 1545597424 2018/12/23 20:37:04 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.39 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Pasi Kallinen, 2018. */
/* NetHack may be freely redistributed. See license for details. */
*/
lax = 0; /* be picky */
max_distance = -1;
-retry:
+ retry:
for (row = 0; row < ROWNO; row++) {
if (viz_rmin[row] < viz_rmax[row]) {
/* There are valid positions on this row. */
display_nhwindow(WIN_MESSAGE, FALSE);
obj = hold_another_object(obj, "Oops!", (const char *) 0,
(const char *) 0);
+ nhUse(obj);
}
-/* zip back to starting location */
-go_back:
+ go_back:
+ /* zip back to starting location */
if (!md_rush(md, start.x, start.y))
md->mx = md->my = 0; /* for mongone, md is not on map */
mongone(md);
-/* deliver some classes of messages even if no daemon ever shows up */
-give_up:
+
+ give_up:
+ /* deliver some classes of messages even if no daemon ever shows up */
if (!message_seen && info->message_typ == MSG_OTHER)
pline("Hark! \"%s.\"", info->display_txt);
}
else
unlink(mailbox);
return;
-bail:
+ bail:
/* bail out _professionally_ */
if (!adminmsg)
pline("It appears to be all gibberish.");
-/* NetHack 3.6 mkobj.c $NHDT-Date: 1542798624 2018/11/21 11:10:24 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.136 $ */
+/* NetHack 3.6 mkobj.c $NHDT-Date: 1545597425 2018/12/23 20:37:05 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.137 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Derek S. Ray, 2015. */
/* NetHack may be freely redistributed. See license for details. */
being included in its formatted name during next message */
iflags.suppress_price++;
if (!tipping) {
- obj = hold_another_object(
- obj, u.uswallow ? "Oops! %s out of your reach!"
- : (Is_airlevel(&u.uz) || Is_waterlevel(&u.uz)
- || levl[u.ux][u.uy].typ < IRONBARS
- || levl[u.ux][u.uy].typ >= ICE)
- ? "Oops! %s away from you!"
- : "Oops! %s to the floor!",
- The(aobjnam(obj, "slip")), (const char *) 0);
+ obj = hold_another_object(obj,
+ u.uswallow
+ ? "Oops! %s out of your reach!"
+ : (Is_airlevel(&u.uz)
+ || Is_waterlevel(&u.uz)
+ || levl[u.ux][u.uy].typ < IRONBARS
+ || levl[u.ux][u.uy].typ >= ICE)
+ ? "Oops! %s away from you!"
+ : "Oops! %s to the floor!",
+ The(aobjnam(obj, "slip")), (char *) 0);
+ nhUse(obj);
} else {
/* assumes this is taking place at hero's location */
if (!can_reach_floor(TRUE)) {
- hitfloor(obj); /* does altar check, message, drop */
+ hitfloor(obj, TRUE); /* does altar check, message, drop */
} else {
if (IS_ALTAR(levl[u.ux][u.uy].typ))
doaltarobj(obj); /* does its own drop message */
-/* NetHack 3.6 pickup.c $NHDT-Date: 1543188989 2018/11/25 23:36:29 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.220 $ */
+/* NetHack 3.6 pickup.c $NHDT-Date: 1545597427 2018/12/23 20:37:07 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.221 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
}
otmp = hold_another_object(otmp, "You drop %s!", doname(otmp),
(const char *) 0);
+ nhUse(otmp);
timepassed = rnd(3);
if (prev_loot)
*prev_loot = TRUE;
if (highdrop) {
/* might break or fall down stairs; handles altars itself */
- hitfloor(otmp);
+ hitfloor(otmp, TRUE);
} else {
if (altarizing) {
doaltarobj(otmp);
-/* NetHack 3.6 potion.c $NHDT-Date: 1545182147 2018/12/19 01:15:47 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.156 $ */
+/* NetHack 3.6 potion.c $NHDT-Date: 1545597429 2018/12/23 20:37:09 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.157 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2013. */
/* NetHack may be freely redistributed. See license for details. */
singlepotion =
hold_another_object(singlepotion, "You juggle and drop %s!",
doname(singlepotion), (const char *) 0);
+ nhUse(singlepotion);
update_inventory();
return 1;
}
-/* NetHack 3.6 uhitm.c $NHDT-Date: 1544840256 2018/12/15 02:17:36 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.196 $ */
+/* NetHack 3.6 uhitm.c $NHDT-Date: 1545597432 2018/12/23 20:37:12 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.197 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
/* give the object to the character */
otmp = hold_another_object(otmp, "You snatched but dropped %s.",
doname(otmp), "You steal: ");
- if (otmp->where != OBJ_INVENT)
+ /* might have dropped otmp, and it might have broken or left level */
+ if (!otmp || otmp->where != OBJ_INVENT)
continue;
if (theft_petrifies(otmp))
break; /* stop thieving even though hero survived */