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

View File

@@ -260,6 +260,22 @@ struct obj {
otmp->otyp == WAX_CANDLE)
#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 */
#define is_graystone(obj) ((obj)->otyp == LUCKSTONE || \
(obj)->otyp == LOADSTONE || \

View File

@@ -1015,10 +1015,7 @@ struct obj *obj;
{
xchar x, y;
if (!obj->lamplit && (obj->otyp == CANDELABRUM_OF_INVOCATION ||
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->lamplit && (obj->otyp == MAGIC_LAMP || ignitable(obj))) {
if ((obj->otyp == MAGIC_LAMP ||
obj->otyp == CANDELABRUM_OF_INVOCATION) &&
obj->spe == 0)

View File

@@ -485,14 +485,7 @@ obj_is_burning(obj)
struct obj *obj;
{
return (obj->lamplit &&
( obj->otyp == MAGIC_LAMP
|| 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)));
(obj->otyp == MAGIC_LAMP || ignitable(obj) || artifact_light(obj)));
}
/* copy the light source(s) attachted to src, and attach it/them to dest */

View File

@@ -1772,8 +1772,7 @@ register struct obj *obj;
sellobj_state(SELL_NORMAL);
}
}
if (Icebox && obj->otyp != OIL_LAMP && obj->otyp != BRASS_LANTERN
&& !Is_candle(obj)) {
if (Icebox && !age_is_relative(obj)) {
obj->age = monstermoves - obj->age; /* actual age */
/* stop any corpse timeouts when frozen */
if (obj->otyp == CORPSE && obj->timed) {
@@ -1868,8 +1867,7 @@ register struct obj *obj;
obj_extract_self(obj);
current_container->owt = weight(current_container);
if (Icebox && obj->otyp != OIL_LAMP && obj->otyp != BRASS_LANTERN
&& !Is_candle(obj)) {
if (Icebox && !age_is_relative(obj)) {
obj->age = monstermoves - obj->age; /* actual age */
if (obj->otyp == CORPSE)
start_corpse_timeout(obj);

View File

@@ -217,11 +217,7 @@ boolean ghostly, frozen;
* to new player's clock. Assumption: new player arrived
* immediately after old player died.
*/
if (ghostly && !frozen
&& otmp->otyp != OIL_LAMP
&& otmp->otyp != BRASS_LANTERN
&& otmp->otyp != CANDELABRUM_OF_INVOCATION
&& !Is_candle(otmp))
if (ghostly && !frozen && !age_is_relative(otmp))
otmp->age = monstermoves - omoves + otmp->age;
/* get contents of a container or statue */