bad "cad" message

From the newsgroup:  taking a shop-owned pick-axe out of a
container inside a shop gave a misleading message telling the
player to take the pick-axe out of the shop.  It was caused by
using the object's `unpaid' field before addtobill() had set it.
This commit is contained in:
nethack.rankin
2002-08-22 01:23:31 +00:00
parent 59a96452ff
commit d5c2438652
2 changed files with 4 additions and 4 deletions

View File

@@ -218,6 +218,7 @@ Shop walls wouldn't be restored if there were pits in the way.
If there were a hole outside a shop, you could kick stuff out of the door
into the hole without the shopkeeper noticing.
curing hallucination while wielding Grayswandir should print a message
removing unowned pick-axe from container in shop gave inappropriate message
Platform- and/or Interface-Specific Fixes

View File

@@ -1,4 +1,4 @@
/* SCCS Id: @(#)pickup.c 3.4 2002/05/15 */
/* SCCS Id: @(#)pickup.c 3.4 2002/08/21 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1871,15 +1871,14 @@ register struct obj *obj;
}
/* simulated point of time */
if (is_pick(obj) && !obj->unpaid && *u.ushops && shop_keeper(*u.ushops))
verbalize("You sneaky cad! Get out of here with that pick!");
if(!obj->unpaid && !carried(current_container) &&
costly_spot(current_container->ox, current_container->oy)) {
obj->ox = current_container->ox;
obj->oy = current_container->oy;
addtobill(obj, FALSE, FALSE, FALSE);
}
if (is_pick(obj) && !obj->unpaid && *u.ushops && shop_keeper(*u.ushops))
verbalize("You sneaky cad! Get out of here with that pick!");
otmp = addinv(obj);
loadlev = near_capacity();