igniting unpaid potions of oil (trunk only)
From another many year old news posting: if you picked up a stack
of potions of oil in a shop and then applied them, one potion was split
off and started burning but you were forced to pay for all of them.
Split the to-be-lit one off first so that the remainder of the stack
stays as ordinary unpaid shop goods.
This also fixes an old bug with bill_dummy_object sometimes charging
a different price than the player got quoted when an object was picked up.
This commit is contained in:
@@ -242,6 +242,9 @@ unicorn horn restoration no longer overrides sustain ability characteristic
|
|||||||
hider monster revived from corpse would start out hidden (even if own corpse
|
hider monster revived from corpse would start out hidden (even if own corpse
|
||||||
was only object around to hide under)
|
was only object around to hide under)
|
||||||
fix sequencing issues with dropping #invoked Heart of Ahriman
|
fix sequencing issues with dropping #invoked Heart of Ahriman
|
||||||
|
applying an unpaid stack of potions of oil forced hero to buy all of them
|
||||||
|
instead of just the one which got split off and lit
|
||||||
|
sometimes when hero is forced to buy an unpaid shop item its price changed
|
||||||
|
|
||||||
|
|
||||||
Platform- and/or Interface-Specific Fixes
|
Platform- and/or Interface-Specific Fixes
|
||||||
|
|||||||
+10
-7
@@ -1265,6 +1265,7 @@ light_cocktail(obj)
|
|||||||
struct obj *obj; /* obj is a potion of oil */
|
struct obj *obj; /* obj is a potion of oil */
|
||||||
{
|
{
|
||||||
char buf[BUFSZ];
|
char buf[BUFSZ];
|
||||||
|
boolean split1off;
|
||||||
|
|
||||||
if (u.uswallow) {
|
if (u.uswallow) {
|
||||||
You(no_elbow_room);
|
You(no_elbow_room);
|
||||||
@@ -1287,8 +1288,12 @@ light_cocktail(obj)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
split1off = (obj->quan > 1L);
|
||||||
|
if (split1off) obj = splitobj(obj, 1L);
|
||||||
|
|
||||||
You("light %spotion.%s", shk_your(buf, obj),
|
You("light %spotion.%s", shk_your(buf, obj),
|
||||||
Blind ? "" : " It gives off a dim light.");
|
Blind ? "" : " It gives off a dim light.");
|
||||||
|
|
||||||
if (obj->unpaid && costly_spot(u.ux, u.uy)) {
|
if (obj->unpaid && costly_spot(u.ux, u.uy)) {
|
||||||
/* Normally, we shouldn't both partially and fully charge
|
/* Normally, we shouldn't both partially and fully charge
|
||||||
* for an item, but (Yendorian Fuel) Taxes are inevitable...
|
* for an item, but (Yendorian Fuel) Taxes are inevitable...
|
||||||
@@ -1299,16 +1304,14 @@ light_cocktail(obj)
|
|||||||
}
|
}
|
||||||
makeknown(obj->otyp);
|
makeknown(obj->otyp);
|
||||||
|
|
||||||
if (obj->quan > 1L) {
|
begin_burn(obj, FALSE); /* after shop billing */
|
||||||
obj = splitobj(obj, 1L);
|
if (split1off) {
|
||||||
begin_burn(obj, FALSE); /* burn before free to get position */
|
|
||||||
obj_extract_self(obj); /* free from inv */
|
obj_extract_self(obj); /* free from inv */
|
||||||
|
obj->nomerge = 1;
|
||||||
/* shouldn't merge */
|
|
||||||
obj = hold_another_object(obj, "You drop %s!",
|
obj = hold_another_object(obj, "You drop %s!",
|
||||||
doname(obj), (const char *)0);
|
doname(obj), (const char *)0);
|
||||||
} else
|
if (obj) obj->nomerge = 0;
|
||||||
begin_burn(obj, FALSE);
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static NEARDATA const char cuddly[] = { TOOL_CLASS, GEM_CLASS, 0 };
|
static NEARDATA const char cuddly[] = { TOOL_CLASS, GEM_CLASS, 0 };
|
||||||
|
|||||||
+5
-6
@@ -465,11 +465,6 @@ struct obj *otmp;
|
|||||||
* an object which is different from what it started out as; the "I x"
|
* an object which is different from what it started out as; the "I x"
|
||||||
* command needs to display the original object.
|
* command needs to display the original object.
|
||||||
*
|
*
|
||||||
* [BUG: The cost might end up being different if item originally had a
|
|
||||||
* surcharge but doesn't get one now or vice versa. Having the dummy keep
|
|
||||||
* the same o_id value as the original would avoid this; is that viable?
|
|
||||||
* (Mustn't give the original itself a new o_id, so can't just swap them.)]
|
|
||||||
*
|
|
||||||
* The caller is responsible for checking otmp->unpaid and
|
* The caller is responsible for checking otmp->unpaid and
|
||||||
* costly_spot(u.ux, u.uy). This function will make otmp no charge.
|
* costly_spot(u.ux, u.uy). This function will make otmp no charge.
|
||||||
*
|
*
|
||||||
@@ -481,9 +476,12 @@ bill_dummy_object(otmp)
|
|||||||
register struct obj *otmp;
|
register struct obj *otmp;
|
||||||
{
|
{
|
||||||
register struct obj *dummy;
|
register struct obj *dummy;
|
||||||
|
long cost = 0L;
|
||||||
|
|
||||||
if (otmp->unpaid)
|
if (otmp->unpaid) {
|
||||||
|
cost = unpaid_cost(otmp, FALSE);
|
||||||
subfrombill(otmp, shop_keeper(*u.ushops));
|
subfrombill(otmp, shop_keeper(*u.ushops));
|
||||||
|
}
|
||||||
dummy = newobj();
|
dummy = newobj();
|
||||||
*dummy = *otmp;
|
*dummy = *otmp;
|
||||||
dummy->oextra = (struct oextra *)0;
|
dummy->oextra = (struct oextra *)0;
|
||||||
@@ -495,6 +493,7 @@ register struct obj *otmp;
|
|||||||
if (has_omid(dummy)) free_omid(dummy); /* only one association with m_id*/
|
if (has_omid(dummy)) free_omid(dummy); /* only one association with m_id*/
|
||||||
if (Is_candle(dummy)) dummy->lamplit = 0;
|
if (Is_candle(dummy)) dummy->lamplit = 0;
|
||||||
addtobill(dummy, FALSE, TRUE, TRUE);
|
addtobill(dummy, FALSE, TRUE, TRUE);
|
||||||
|
if (cost) alter_cost(dummy, -cost);
|
||||||
/* no_charge is only valid for some locations */
|
/* no_charge is only valid for some locations */
|
||||||
otmp->no_charge = (otmp->where == OBJ_FLOOR ||
|
otmp->no_charge = (otmp->where == OBJ_FLOOR ||
|
||||||
otmp->where == OBJ_CONTAINED) ? 1 : 0;
|
otmp->where == OBJ_CONTAINED) ? 1 : 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user