B20007 age of potion of oil from bones

First From a bug report.4.1 beta 20.
This commit is contained in:
nethack.allison
2003-03-17 01:20:41 +00:00
parent 4cf1b2964d
commit 96b149208f
5 changed files with 21 additions and 21 deletions
+16
View File
@@ -260,6 +260,22 @@ struct obj {
otmp->otyp == WAX_CANDLE) otmp->otyp == WAX_CANDLE)
#define MAX_OIL_IN_FLASK 400 /* maximum amount of oil in a potion of oil */ #define MAX_OIL_IN_FLASK 400 /* maximum amount of oil in a potion of oil */
/* MAGIC_LAMP intentionally excluded below */
/* age field of this is relative age rather than absolute */
#define age_is_relative(otmp) ((otmp)->otyp == BRASS_LANTERN\
|| (otmp)->otyp == OIL_LAMP\
|| (otmp)->otyp == CANDELABRUM_OF_INVOCATION\
|| (otmp)->otyp == TALLOW_CANDLE\
|| (otmp)->otyp == WAX_CANDLE\
|| (otmp)->otyp == POT_OIL)
/* object can be ignited */
#define ignitable(otmp) ((otmp)->otyp == BRASS_LANTERN\
|| (otmp)->otyp == OIL_LAMP\
|| (otmp)->otyp == CANDELABRUM_OF_INVOCATION\
|| (otmp)->otyp == TALLOW_CANDLE\
|| (otmp)->otyp == WAX_CANDLE\
|| (otmp)->otyp == POT_OIL)
/* special stones */ /* special stones */
#define is_graystone(obj) ((obj)->otyp == LUCKSTONE || \ #define is_graystone(obj) ((obj)->otyp == LUCKSTONE || \
(obj)->otyp == LOADSTONE || \ (obj)->otyp == LOADSTONE || \
+1 -4
View File
@@ -1015,10 +1015,7 @@ struct obj *obj;
{ {
xchar x, y; xchar x, y;
if (!obj->lamplit && (obj->otyp == CANDELABRUM_OF_INVOCATION || if (!obj->lamplit && (obj->otyp == MAGIC_LAMP || ignitable(obj))) {
obj->otyp == WAX_CANDLE || obj->otyp == TALLOW_CANDLE ||
obj->otyp == OIL_LAMP || obj->otyp == MAGIC_LAMP ||
obj->otyp == BRASS_LANTERN || obj->otyp == POT_OIL)) {
if ((obj->otyp == MAGIC_LAMP || if ((obj->otyp == MAGIC_LAMP ||
obj->otyp == CANDELABRUM_OF_INVOCATION) && obj->otyp == CANDELABRUM_OF_INVOCATION) &&
obj->spe == 0) obj->spe == 0)
+1 -8
View File
@@ -485,14 +485,7 @@ obj_is_burning(obj)
struct obj *obj; struct obj *obj;
{ {
return (obj->lamplit && return (obj->lamplit &&
( obj->otyp == MAGIC_LAMP (obj->otyp == MAGIC_LAMP || ignitable(obj) || artifact_light(obj)));
|| obj->otyp == BRASS_LANTERN
|| obj->otyp == OIL_LAMP
|| obj->otyp == CANDELABRUM_OF_INVOCATION
|| obj->otyp == TALLOW_CANDLE
|| obj->otyp == WAX_CANDLE
|| obj->otyp == POT_OIL
|| artifact_light(obj)));
} }
/* copy the light source(s) attachted to src, and attach it/them to dest */ /* copy the light source(s) attachted to src, and attach it/them to dest */
+2 -4
View File
@@ -1772,8 +1772,7 @@ register struct obj *obj;
sellobj_state(SELL_NORMAL); sellobj_state(SELL_NORMAL);
} }
} }
if (Icebox && obj->otyp != OIL_LAMP && obj->otyp != BRASS_LANTERN if (Icebox && !age_is_relative(obj)) {
&& !Is_candle(obj)) {
obj->age = monstermoves - obj->age; /* actual age */ obj->age = monstermoves - obj->age; /* actual age */
/* stop any corpse timeouts when frozen */ /* stop any corpse timeouts when frozen */
if (obj->otyp == CORPSE && obj->timed) { if (obj->otyp == CORPSE && obj->timed) {
@@ -1868,8 +1867,7 @@ register struct obj *obj;
obj_extract_self(obj); obj_extract_self(obj);
current_container->owt = weight(current_container); current_container->owt = weight(current_container);
if (Icebox && obj->otyp != OIL_LAMP && obj->otyp != BRASS_LANTERN if (Icebox && !age_is_relative(obj)) {
&& !Is_candle(obj)) {
obj->age = monstermoves - obj->age; /* actual age */ obj->age = monstermoves - obj->age; /* actual age */
if (obj->otyp == CORPSE) if (obj->otyp == CORPSE)
start_corpse_timeout(obj); start_corpse_timeout(obj);
+1 -5
View File
@@ -217,11 +217,7 @@ boolean ghostly, frozen;
* to new player's clock. Assumption: new player arrived * to new player's clock. Assumption: new player arrived
* immediately after old player died. * immediately after old player died.
*/ */
if (ghostly && !frozen if (ghostly && !frozen && !age_is_relative(otmp))
&& otmp->otyp != OIL_LAMP
&& otmp->otyp != BRASS_LANTERN
&& otmp->otyp != CANDELABRUM_OF_INVOCATION
&& !Is_candle(otmp))
otmp->age = monstermoves - omoves + otmp->age; otmp->age = monstermoves - omoves + otmp->age;
/* get contents of a container or statue */ /* get contents of a container or statue */