First From a bug report.4.1 beta 20.
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 || \
{
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)
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 */
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) {
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);
* 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 */