hangups with temp gold in inventory
- Implement Michael's suggestion of marking temp gold put in inventory so it can be cleaned up during restore.
This commit is contained in:
@@ -109,6 +109,7 @@ when polymorphed, player killing a paper or straw golem via fire damage
|
|||||||
would kill the golem twice, resulting in an impossible error
|
would kill the golem twice, resulting in an impossible error
|
||||||
usually stop mimicing if you polymorph while using #monster mimic capability
|
usually stop mimicing if you polymorph while using #monster mimic capability
|
||||||
under !GOLDOBJ, gold shouldn't disappear if you try to throw it at yourself
|
under !GOLDOBJ, gold shouldn't disappear if you try to throw it at yourself
|
||||||
|
under !GOLDOBJ, remove temp gold from inventory during restore
|
||||||
|
|
||||||
|
|
||||||
Platform- and/or Interface-Specific Fixes
|
Platform- and/or Interface-Specific Fixes
|
||||||
|
|||||||
@@ -614,6 +614,7 @@ int retry;
|
|||||||
/* Hack: gold is not in the inventory, so make a gold object
|
/* Hack: gold is not in the inventory, so make a gold object
|
||||||
and put it at the head of the inventory list. */
|
and put it at the head of the inventory list. */
|
||||||
u_gold = mkgoldobj(u.ugold); /* removes from u.ugold */
|
u_gold = mkgoldobj(u.ugold); /* removes from u.ugold */
|
||||||
|
u_gold->in_use = TRUE;
|
||||||
u.ugold = u_gold->quan; /* put the gold back */
|
u.ugold = u_gold->quan; /* put the gold back */
|
||||||
assigninvlet(u_gold); /* might end up as NOINVSYM */
|
assigninvlet(u_gold); /* might end up as NOINVSYM */
|
||||||
u_gold->nobj = invent;
|
u_gold->nobj = invent;
|
||||||
@@ -686,6 +687,7 @@ int retry;
|
|||||||
/* didn't drop [all of] it */
|
/* didn't drop [all of] it */
|
||||||
u_gold = invent;
|
u_gold = invent;
|
||||||
invent = u_gold->nobj;
|
invent = u_gold->nobj;
|
||||||
|
u_gold->in_use = FALSE;
|
||||||
dealloc_obj(u_gold);
|
dealloc_obj(u_gold);
|
||||||
update_inventory();
|
update_inventory();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -480,6 +480,7 @@ struct obj *obj;
|
|||||||
if (obj->oclass == GOLD_CLASS) {
|
if (obj->oclass == GOLD_CLASS) {
|
||||||
#ifndef GOLDOBJ
|
#ifndef GOLDOBJ
|
||||||
u.ugold -= obj->quan;
|
u.ugold -= obj->quan;
|
||||||
|
obj->in_use = FALSE;
|
||||||
#endif
|
#endif
|
||||||
flags.botl = 1;
|
flags.botl = 1;
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -2084,6 +2084,7 @@ ask_again2:
|
|||||||
* and put it at the head of the inventory list.
|
* and put it at the head of the inventory list.
|
||||||
*/
|
*/
|
||||||
u_gold = mkgoldobj(u.ugold); /* removes from u.ugold */
|
u_gold = mkgoldobj(u.ugold); /* removes from u.ugold */
|
||||||
|
u_gold->in_use = TRUE;
|
||||||
u.ugold = u_gold->quan; /* put the gold back */
|
u.ugold = u_gold->quan; /* put the gold back */
|
||||||
assigninvlet(u_gold); /* might end up as NOINVSYM */
|
assigninvlet(u_gold); /* might end up as NOINVSYM */
|
||||||
u_gold->nobj = invent;
|
u_gold->nobj = invent;
|
||||||
@@ -2118,6 +2119,7 @@ ask_again2:
|
|||||||
/* didn't stash [all of] it */
|
/* didn't stash [all of] it */
|
||||||
u_gold = invent;
|
u_gold = invent;
|
||||||
invent = u_gold->nobj;
|
invent = u_gold->nobj;
|
||||||
|
u_gold->in_use = FALSE;
|
||||||
dealloc_obj(u_gold);
|
dealloc_obj(u_gold);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -106,6 +106,17 @@ boolean quietly;
|
|||||||
|
|
||||||
for (otmp = invent; otmp; otmp = otmp2) {
|
for (otmp = invent; otmp; otmp = otmp2) {
|
||||||
otmp2 = otmp->nobj;
|
otmp2 = otmp->nobj;
|
||||||
|
#ifndef GOLDOBJ
|
||||||
|
if (otmp->oclass == GOLD_CLASS) {
|
||||||
|
/* in_use gold is created by some menu operations */
|
||||||
|
if (!otmp->in_use) {
|
||||||
|
impossible("inven_inuse: !in_use gold in inventory");
|
||||||
|
}
|
||||||
|
extract_nobj(otmp, &invent);
|
||||||
|
otmp->in_use = FALSE;
|
||||||
|
dealloc_obj(otmp);
|
||||||
|
} else
|
||||||
|
#endif /* GOLDOBJ */
|
||||||
if (otmp->in_use) {
|
if (otmp->in_use) {
|
||||||
if (!quietly) pline("Finishing off %s...", xname(otmp));
|
if (!quietly) pline("Finishing off %s...", xname(otmp));
|
||||||
useup(otmp);
|
useup(otmp);
|
||||||
|
|||||||
+47
-47
@@ -2494,64 +2494,64 @@ boolean *lostsome;
|
|||||||
{
|
{
|
||||||
int invc = inv_cnt();
|
int invc = inv_cnt();
|
||||||
|
|
||||||
|
|
||||||
while (near_capacity() > (Punished ? UNENCUMBERED : SLT_ENCUMBER)) {
|
while (near_capacity() > (Punished ? UNENCUMBERED : SLT_ENCUMBER)) {
|
||||||
register struct obj *obj, *otmp = (struct obj *)0;
|
register struct obj *obj, *otmp = (struct obj *)0;
|
||||||
register int i;
|
register int i;
|
||||||
|
|
||||||
/* Pick a random object */
|
/* Pick a random object */
|
||||||
if (invc > 0) {
|
if (invc > 0) {
|
||||||
i = rn2(invc);
|
i = rn2(invc);
|
||||||
for (obj = invent; obj; obj = obj->nobj) {
|
for (obj = invent; obj; obj = obj->nobj) {
|
||||||
/*
|
/*
|
||||||
* Undroppables are: body armor, boots, gloves,
|
* Undroppables are: body armor, boots, gloves,
|
||||||
* amulets, and rings because of the time and effort
|
* amulets, and rings because of the time and effort
|
||||||
* in removing them + loadstone and other cursed stuff
|
* in removing them + loadstone and other cursed stuff
|
||||||
* for obvious reasons.
|
* for obvious reasons.
|
||||||
*/
|
*/
|
||||||
if (!((obj->otyp == LOADSTONE && obj->cursed) ||
|
if (!((obj->otyp == LOADSTONE && obj->cursed) ||
|
||||||
obj == uamul || obj == uleft || obj == uright ||
|
obj == uamul || obj == uleft || obj == uright ||
|
||||||
obj == ublindf || obj == uarm || obj == uarmc ||
|
obj == ublindf || obj == uarm || obj == uarmc ||
|
||||||
obj == uarmg || obj == uarmf ||
|
obj == uarmg || obj == uarmf ||
|
||||||
#ifdef TOURIST
|
#ifdef TOURIST
|
||||||
obj == uarmu ||
|
obj == uarmu ||
|
||||||
#endif
|
#endif
|
||||||
(obj->cursed && (obj == uarmh || obj == uarms)) ||
|
(obj->cursed && (obj == uarmh || obj == uarms)) ||
|
||||||
welded(obj)))
|
welded(obj)))
|
||||||
otmp = obj;
|
otmp = obj;
|
||||||
/* reached the mark and found some stuff to drop? */
|
/* reached the mark and found some stuff to drop? */
|
||||||
if (--i < 0 && otmp) break;
|
if (--i < 0 && otmp) break;
|
||||||
|
|
||||||
/* else continue */
|
/* else continue */
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#ifndef GOLDOBJ
|
#ifndef GOLDOBJ
|
||||||
if (!otmp) {
|
if (!otmp) {
|
||||||
/* Nothing available left to drop; try gold */
|
/* Nothing available left to drop; try gold */
|
||||||
if (u.ugold) {
|
if (u.ugold) {
|
||||||
pline("In desperation, you drop your purse.");
|
pline("In desperation, you drop your purse.");
|
||||||
/* Hack: gold is not in the inventory, so make a gold object
|
/* Hack: gold is not in the inventory, so make a gold object
|
||||||
* and put it at the head of the inventory list.
|
* and put it at the head of the inventory list.
|
||||||
*/
|
*/
|
||||||
obj = mkgoldobj(u.ugold); /* removes from u.ugold */
|
obj = mkgoldobj(u.ugold); /* removes from u.ugold */
|
||||||
u.ugold = obj->quan; /* put the gold back */
|
obj->in_use = TRUE;
|
||||||
assigninvlet(obj); /* might end up as NOINVSYM */
|
u.ugold = obj->quan; /* put the gold back */
|
||||||
obj->nobj = invent;
|
assigninvlet(obj); /* might end up as NOINVSYM */
|
||||||
invent = obj;
|
obj->nobj = invent;
|
||||||
*lostsome = TRUE;
|
invent = obj;
|
||||||
dropx(obj);
|
*lostsome = TRUE;
|
||||||
continue; /* Try again */
|
dropx(obj);
|
||||||
}
|
continue; /* Try again */
|
||||||
/* We can't even drop gold! */
|
|
||||||
return (FALSE);
|
|
||||||
}
|
}
|
||||||
|
/* We can't even drop gold! */
|
||||||
|
return (FALSE);
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
if (!otmp) return (FALSE); /* nothing to drop! */
|
if (!otmp) return (FALSE); /* nothing to drop! */
|
||||||
#endif
|
#endif
|
||||||
if (otmp->owornmask) remove_worn_item(otmp, FALSE);
|
if (otmp->owornmask) remove_worn_item(otmp, FALSE);
|
||||||
*lostsome = TRUE;
|
*lostsome = TRUE;
|
||||||
dropx(otmp);
|
dropx(otmp);
|
||||||
invc--;
|
invc--;
|
||||||
}
|
}
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user