E void FDECL(use_unicorn_horn, (struct obj *));
E boolean FDECL(tinnable, (struct obj *));
E void NDECL(reset_trapset);
-E void FDECL(fig_transform, (genericptr_t, long));
+E void FDECL(fig_transform, (ANY_P *, long));
E int FDECL(unfixable_trouble_count,(BOOLEAN_P));
/* ### artifact.c ### */
E struct obj *FDECL(bury_an_obj, (struct obj *));
E void FDECL(bury_objs, (int,int));
E void FDECL(unearth_objs, (int,int));
-E void FDECL(rot_organic, (genericptr_t, long));
-E void FDECL(rot_corpse, (genericptr_t, long));
+E void FDECL(rot_organic, (ANY_P *, long));
+E void FDECL(rot_corpse, (ANY_P *, long));
E struct obj *FDECL(buried_ball, (coord *));
E void NDECL(buried_ball_to_punishment);
E void NDECL(buried_ball_to_freedom);
const char *,const char *));
E void NDECL(deferred_goto);
E boolean FDECL(revive_corpse, (struct obj *));
-E void FDECL(revive_mon, (genericptr_t, long));
+E void FDECL(revive_mon, (ANY_P *, long));
E int NDECL(donull);
E int NDECL(dowipe);
E void FDECL(set_wounded_legs, (long,int));
E void FDECL(attach_egg_hatch_timeout, (struct obj *));
E void FDECL(attach_fig_transform_timeout, (struct obj *));
E void FDECL(kill_egg, (struct obj *));
-E void FDECL(hatch_egg, (genericptr_t, long));
+E void FDECL(hatch_egg, (ANY_P *, long));
E void FDECL(learn_egg_type, (int));
-E void FDECL(burn_object, (genericptr_t, long));
+E void FDECL(burn_object, (ANY_P *, long));
E void FDECL(begin_burn, (struct obj *, BOOLEAN_P));
E void FDECL(end_burn, (struct obj *, BOOLEAN_P));
E void NDECL(do_storms);
-E boolean FDECL(start_timer, (long, SHORT_P, SHORT_P, genericptr_t));
-E long FDECL(stop_timer, (SHORT_P, genericptr_t));
-E long FDECL(peek_timer, (SHORT_P,genericptr_t));
+E boolean FDECL(start_timer, (long, SHORT_P, SHORT_P, ANY_P *));
+E long FDECL(stop_timer, (SHORT_P, ANY_P *));
+E long FDECL(peek_timer, (SHORT_P,ANY_P *));
E void NDECL(run_timers);
E void FDECL(obj_move_timers, (struct obj *, struct obj *));
E void FDECL(obj_split_timers, (struct obj *, struct obj *));
E void FDECL(buzz, (int,int,XCHAR_P,XCHAR_P,int,int));
E void FDECL(melt_ice, (XCHAR_P,XCHAR_P,const char *));
E void FDECL(start_melt_ice_timeout, (XCHAR_P,XCHAR_P));
-E void FDECL(melt_ice_away, (genericptr_t, long));
+E void FDECL(melt_ice_away, (ANY_P *, long));
E int FDECL(zap_over_floor, (XCHAR_P,XCHAR_P,int,boolean *,SHORT_P));
E void FDECL(fracture_rock, (struct obj *));
E boolean FDECL(break_statue, (struct obj *));
* Incrementing EDITLEVEL can be used to force invalidation of old bones
* and save files.
*/
-#define EDITLEVEL 34
+#define EDITLEVEL 35
#define COPYRIGHT_BANNER_A \
"NetHack, Copyright 1985-2006"
#define TIMEOUT_H
/* generic timeout function */
-typedef void FDECL((*timeout_proc), (genericptr_t, long));
+typedef void FDECL((*timeout_proc), (ANY_P *, long));
/* kind of timer */
#define TIMER_LEVEL 0 /* event specific to level */
unsigned long tid; /* timer ID */
short kind; /* kind of use */
short func_index; /* what to call when we time out */
- genericptr_t arg; /* pointer to timeout argument */
+ anything arg; /* pointer to timeout argument */
Bitfield (needs_fixup,1); /* does arg need to be patched? */
} timer_element;
*/
void
fig_transform(arg, timeout)
-genericptr_t arg;
+anything *arg;
long timeout;
{
- struct obj *figurine = (struct obj *)arg;
+ struct obj *figurine = arg->a_obj;
struct monst *mtmp;
coord cc;
boolean cansee_spot, silent, okay_spot;
!figurine_location_checks(figurine,&cc, TRUE)) {
/* reset the timer to try again later */
(void) start_timer((long)rnd(5000), TIMER_OBJECT,
- FIG_TRANSFORM, (genericptr_t)figurine);
+ FIG_TRANSFORM, obj_to_any(figurine));
return;
}
"toss the figurine into the air" :
"set the figurine on the ground"));
(void) make_familiar(obj, cc.x, cc.y, FALSE);
- (void) stop_timer(FIG_TRANSFORM, (genericptr_t)obj);
+ (void) stop_timer(FIG_TRANSFORM, obj_to_any(obj));
useup(obj);
*optr = 0;
}
-/* SCCS Id: @(#)dig.c 3.5 2006/06/25 */
+/* SCCS Id: @(#)dig.c 3.5 2006/07/08 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
#if 0
/* rusting buried metallic objects is not implemented yet */
if (ball->timed)
- (void) stop_timer(RUST_METAL, (genericptr_t)ball);
+ (void) stop_timer(RUST_METAL, obj_to_any(ball));
#endif
punish(ball); /* use ball as flag for unearthed buried ball */
u.utrap = 0;
#if 0
/* rusting buried metallic objects is not implemented yet */
if (ball->timed)
- (void) stop_timer(RUST_METAL, (genericptr_t)ball);
+ (void) stop_timer(RUST_METAL, obj_to_any(ball));
#endif
place_object(ball, cc.x, cc.y);
stackobj(ball);
} else if ((under_ice ? otmp->oclass == POTION_CLASS : is_organic(otmp))
&& !obj_resists(otmp, 5, 95)) {
(void) start_timer((under_ice ? 0L : 250L) + (long)rnd(250),
- TIMER_OBJECT, ROT_ORGANIC, (genericptr_t)otmp);
+ TIMER_OBJECT, ROT_ORGANIC, obj_to_any(otmp));
}
#if 0
/* rusting of buried metal not yet implemented */
else if (is_rustprone(otmp)) {
(void) start_timer((long)rnd(otmp->otyp == HEAVY_IRON_BALL ? 1500 : 250),
- TIMER_OBJECT, RUST_METAL, (genericptr_t)otmp);
+ TIMER_OBJECT, RUST_METAL, obj_to_any(otmp));
}
#endif
add_to_buried(otmp);
else {
obj_extract_self(otmp);
if (otmp->timed)
- (void) stop_timer(ROT_ORGANIC, (genericptr_t)otmp);
+ (void) stop_timer(ROT_ORGANIC, obj_to_any(otmp));
place_object(otmp, x, y);
stackobj(otmp);
}
/* ARGSUSED */
void
rot_organic(arg, timeout)
-genericptr_t arg;
+anything *arg;
long timeout; /* unused */
{
- struct obj *obj = (struct obj *) arg;
+ struct obj *obj = arg->a_obj;
while (Has_contents(obj)) {
/* We don't need to place contained object on the floor
*/
void
rot_corpse(arg, timeout)
-genericptr_t arg;
+anything *arg;
long timeout; /* unused */
{
xchar x = 0, y = 0;
- struct obj *obj = (struct obj *) arg;
+ struct obj *obj = arg->a_obj;
boolean on_floor = obj->where == OBJ_FLOOR,
in_invent = obj->where == OBJ_INVENT;
-/* SCCS Id: @(#)do.c 3.5 2006/06/25 */
+/* SCCS Id: @(#)do.c 3.5 2006/07/08 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
/*ARGSUSED*/
void
revive_mon(arg, timeout)
-genericptr_t arg;
+anything *arg;
long timeout;
{
- struct obj *body = (struct obj *) arg;
+ struct obj *body = arg->a_obj;
/* if we succeed, the corpse is gone, otherwise, rot it away */
if (!revive_corpse(body)) {
set_moreluck();
context.botl = 1;
} else if (obj->otyp == FIGURINE && obj->timed) {
- (void) stop_timer(FIG_TRANSFORM, (genericptr_t) obj);
+ (void) stop_timer(FIG_TRANSFORM, obj_to_any(obj));
}
}
*/
otmp->age = 0L;
if (otmp->timed) {
- (void) stop_timer(ROT_CORPSE, (genericptr_t)otmp);
- (void) stop_timer(REVIVE_MON, (genericptr_t)otmp);
+ (void) stop_timer(ROT_CORPSE, obj_to_any(otmp));
+ (void) stop_timer(REVIVE_MON, obj_to_any(otmp));
}
} else {
register int tprob;
}
if (body->norevive) body->norevive = 0;
- (void) start_timer(when, TIMER_OBJECT, action, (genericptr_t)body);
+ (void) start_timer(when, TIMER_OBJECT, action, obj_to_any(body));
}
void
else if (otmp->otyp == BAG_OF_HOLDING)
otmp->owt = weight(otmp);
else if (otmp->otyp == FIGURINE && otmp->timed)
- (void) stop_timer(FIG_TRANSFORM, (genericptr_t) otmp);
+ (void) stop_timer(FIG_TRANSFORM, obj_to_any(otmp));
return;
}
else if (otmp->otyp == BAG_OF_HOLDING)
otmp->owt = weight(otmp);
else if (otmp->otyp == FIGURINE && otmp->timed)
- (void) stop_timer(FIG_TRANSFORM, (genericptr_t) otmp);
+ (void) stop_timer(FIG_TRANSFORM, obj_to_any(otmp));
return;
}
/* Check for corpses just placed on or in ice */
if (otmp->otyp == CORPSE && (on_floor || buried) && is_ice(x,y)) {
- tleft = stop_timer(action, (genericptr_t)otmp);
+ tleft = stop_timer(action, obj_to_any(otmp));
if (tleft == 0L) {
action = REVIVE_MON;
- tleft = stop_timer(action, (genericptr_t)otmp);
+ tleft = stop_timer(action, obj_to_any(otmp));
}
if (tleft != 0L) {
long age;
else if ((force < 0) ||
(otmp->otyp == CORPSE && otmp->on_ice &&
((on_floor && !is_ice(x,y)) || !on_floor))) {
- tleft = stop_timer(action, (genericptr_t)otmp);
+ tleft = stop_timer(action, obj_to_any(otmp));
if (tleft == 0L) {
action = REVIVE_MON;
- tleft = stop_timer(action, (genericptr_t)otmp);
+ tleft = stop_timer(action, obj_to_any(otmp));
}
if (tleft != 0L) {
long age;
}
/* now re-start the timer with the appropriate modifications */
if (restart_timer)
- (void) start_timer(tleft, TIMER_OBJECT, action, (genericptr_t)otmp);
+ (void) start_timer(tleft, TIMER_OBJECT, action, obj_to_any(otmp));
}
#undef ROT_ICE_ADJUSTMENT
-/* SCCS Id: @(#)pickup.c 3.5 2006/06/17 */
+/* SCCS Id: @(#)pickup.c 3.5 2006/07/08 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
obj->age = monstermoves - obj->age; /* actual age */
/* stop any corpse timeouts when frozen */
if (obj->otyp == CORPSE && obj->timed) {
- long rot_alarm = stop_timer(ROT_CORPSE, (genericptr_t)obj);
- (void) stop_timer(REVIVE_MON, (genericptr_t)obj);
+ long rot_alarm = stop_timer(ROT_CORPSE, obj_to_any(obj));
+ (void) stop_timer(REVIVE_MON, obj_to_any(obj));
/* mark a non-reviving corpse as such */
if (rot_alarm) obj->norevive = 1;
}
STATIC_DCL void NDECL(slip_or_trip);
STATIC_DCL void FDECL(see_lamp_flicker, (struct obj *, const char *));
STATIC_DCL void FDECL(lantern_message, (struct obj *));
-STATIC_DCL void FDECL(cleanup_burn, (genericptr_t,long));
+STATIC_DCL void FDECL(cleanup_burn, (ANY_P *,long));
/* He is being petrified - dialogue by inmet!tower */
static NEARDATA const char * const stoned_texts[] = {
int i;
/* stop previous timer, if any */
- (void) stop_timer(HATCH_EGG, (genericptr_t) egg);
+ (void) stop_timer(HATCH_EGG, obj_to_any(egg));
/*
* Decide if and when to hatch the egg. The old hatch_it() code tried
if (rnd(i) > 150) {
/* egg will hatch */
(void) start_timer((long)i, TIMER_OBJECT,
- HATCH_EGG, (genericptr_t)egg);
+ HATCH_EGG, obj_to_any(egg));
break;
}
}
struct obj *egg;
{
/* stop previous timer, if any */
- (void) stop_timer(HATCH_EGG, (genericptr_t) egg);
+ (void) stop_timer(HATCH_EGG, obj_to_any(egg));
}
/* timer callback routine: hatch the given egg */
void
hatch_egg(arg, timeout)
-genericptr_t arg;
+anything *arg;
long timeout;
{
struct obj *egg;
boolean cansee_hatchspot = FALSE;
int i, mnum, hatchcount = 0;
- egg = (struct obj *) arg;
+ egg = arg->a_obj;
/* sterilized while waiting */
if (egg->corpsenm == NON_PM) return;
attach_egg_hatch_timeout(egg);
if (egg->timed) {
/* replace ordinary egg timeout with a short one */
- (void) stop_timer(HATCH_EGG, (genericptr_t)egg);
+ (void) stop_timer(HATCH_EGG, obj_to_any(egg));
(void) start_timer((long)rnd(12), TIMER_OBJECT,
- HATCH_EGG, (genericptr_t)egg);
+ HATCH_EGG, obj_to_any(egg));
}
} else if (carried(egg)) {
useup(egg);
int i;
/* stop previous timer, if any */
- (void) stop_timer(FIG_TRANSFORM, (genericptr_t) figurine);
+ (void) stop_timer(FIG_TRANSFORM, obj_to_any(figurine));
/*
* Decide when to transform the figurine.
i = rnd(9000) + 200;
/* figurine will transform */
(void) start_timer((long)i, TIMER_OBJECT,
- FIG_TRANSFORM, (genericptr_t)figurine);
+ FIG_TRANSFORM, obj_to_any(figurine));
}
/* give a fumble message */
*/
void
burn_object(arg, timeout)
-genericptr_t arg;
+anything *arg;
long timeout;
{
- struct obj *obj = (struct obj *) arg;
+ struct obj *obj = arg->a_obj;
boolean canseeit, many, menorah, need_newsym;
xchar x, y;
char whose[BUFSZ];
if (do_timer) {
if (start_timer(turns, TIMER_OBJECT,
- BURN_OBJECT, (genericptr_t)obj)) {
+ BURN_OBJECT, obj_to_any(obj))) {
obj->lamplit = 1;
obj->age -= turns;
if (carried(obj) && !already_lit)
obj->lamplit = 0;
if (obj->where == OBJ_INVENT)
update_inventory();
- } else if (!stop_timer(BURN_OBJECT, (genericptr_t) obj))
+ } else if (!stop_timer(BURN_OBJECT, obj_to_any(obj)))
impossible("end_burn: obj %s not timed!", xname(obj));
}
*/
static void
cleanup_burn(arg, expire_time)
- genericptr_t arg;
+ anything *arg;
long expire_time;
{
- struct obj *obj = (struct obj *)arg;
+ struct obj *obj = arg->a_obj;
if (!obj->lamplit) {
impossible("cleanup_burn: obj %s not lit", xname(obj));
return;
*
* General:
* boolean start_timer(long timeout,short kind,short func_index,
- * genericptr_t arg)
+ * anything *arg)
* Start a timer of kind 'kind' that will expire at time
* monstermoves+'timeout'. Call the function at 'func_index'
* in the timeout table using argument 'arg'. Return TRUE if
* "sooner" to "later". If an object, increment the object's
* timer count.
*
- * long stop_timer(short func_index, genericptr_t arg)
+ * long stop_timer(short func_index, anything *arg)
* Stop a timer specified by the (func_index, arg) pair. This
* assumes that such a pair is unique. Return the time the
* timer would have gone off. If no timer is found, return 0.
* If an object, decrement the object's timer count.
*
- * long peek_timer(short func_index, genericptr_t arg)
+ * long peek_timer(short func_index, anything *arg)
* Return time specified timer will go off (0 if no such timer).
*
* void run_timers(void)
#endif
STATIC_DCL void FDECL(insert_timer, (timer_element *));
STATIC_DCL timer_element *FDECL(remove_timer, (timer_element **, SHORT_P,
- genericptr_t));
+ ANY_P *));
STATIC_DCL void FDECL(write_timer, (int, timer_element *));
STATIC_DCL boolean FDECL(mon_is_local, (struct monst *));
STATIC_DCL boolean FDECL(timer_is_local, (timer_element *));
Sprintf(buf, " %4ld %4ld %-6s %s(%s)",
curr->timeout, curr->tid, kind_name(curr->kind),
timeout_funcs[curr->func_index].name,
- fmt_ptr((genericptr_t)curr->arg));
+ fmt_ptr((genericptr_t)curr->arg.a_void));
#else
Sprintf(buf, " %4ld %4ld %-6s #%d(%s)",
curr->timeout, curr->tid, kind_name(curr->kind),
curr->func_index,
- fmt_ptr((genericptr_t)curr->arg));
+ fmt_ptr((genericptr_t)curr->arg.a_void));
#endif
putstr(win, 0, buf);
}
/* this should be much more complete */
for (curr = timer_base; curr; curr = curr->next)
if (curr->kind == TIMER_OBJECT) {
- struct obj *obj = (struct obj *) curr->arg;
+ struct obj *obj = curr->arg.a_obj;
if (obj->timed == 0) {
pline("timer sanity: untimed obj %s, timer %ld",
fmt_ptr((genericptr_t)obj), curr->tid);
curr = timer_base;
timer_base = curr->next;
- if (curr->kind == TIMER_OBJECT) ((struct obj *)(curr->arg))->timed--;
- (*timeout_funcs[curr->func_index].f)(curr->arg, curr->timeout);
+ if (curr->kind == TIMER_OBJECT) (curr->arg.a_obj)->timed--;
+ (*timeout_funcs[curr->func_index].f)(&curr->arg, curr->timeout);
free((genericptr_t) curr);
}
}
long when;
short kind;
short func_index;
-genericptr_t arg;
+anything *arg;
{
timer_element *gnu;
gnu->kind = kind;
gnu->needs_fixup = 0;
gnu->func_index = func_index;
- gnu->arg = arg;
+ gnu->arg = *arg;
insert_timer(gnu);
if (kind == TIMER_OBJECT) /* increment object's timed count */
- ((struct obj *)arg)->timed++;
+ (arg->a_obj)->timed++;
/* should check for duplicates and fail if any */
return TRUE;
long
stop_timer(func_index, arg)
short func_index;
-genericptr_t arg;
+anything *arg;
{
timer_element *doomed;
long timeout;
if (doomed) {
timeout = doomed->timeout;
if (doomed->kind == TIMER_OBJECT)
- ((struct obj *)arg)->timed--;
+ (arg->a_obj)->timed--;
if (timeout_funcs[doomed->func_index].cleanup)
(*timeout_funcs[doomed->func_index].cleanup)(arg, timeout);
free((genericptr_t) doomed);
long
peek_timer(type, arg)
short type;
- genericptr_t arg;
+ anything *arg;
{
timer_element *curr;
for (curr = timer_base; curr; curr = curr->next) {
- if (curr->func_index == type && curr->arg == arg)
+ if (curr->func_index == type && curr->arg.a_void == arg->a_void)
return curr->timeout;
}
return 0L;
timer_element *curr;
for (count = 0, curr = timer_base; curr; curr = curr->next)
- if (curr->kind == TIMER_OBJECT && curr->arg == (genericptr_t)src) {
- curr->arg = (genericptr_t) dest;
+ if (curr->kind == TIMER_OBJECT && curr->arg.a_obj == src) {
+ curr->arg.a_obj = dest;
dest->timed++;
count++;
}
for (curr = timer_base; curr; curr = next_timer) {
next_timer = curr->next; /* things may be inserted */
- if (curr->kind == TIMER_OBJECT && curr->arg == (genericptr_t)src) {
+ if (curr->kind == TIMER_OBJECT && curr->arg.a_obj == src) {
(void) start_timer(curr->timeout-monstermoves, TIMER_OBJECT,
- curr->func_index, (genericptr_t)dest);
+ curr->func_index, obj_to_any(dest));
}
}
}
for (prev = 0, curr = timer_base; curr; curr = next_timer) {
next_timer = curr->next;
- if (curr->kind == TIMER_OBJECT && curr->arg == (genericptr_t)obj) {
+ if (curr->kind == TIMER_OBJECT && curr->arg.a_obj == obj) {
if (prev)
prev->next = curr->next;
else
timer_base = curr->next;
if (timeout_funcs[curr->func_index].cleanup)
- (*timeout_funcs[curr->func_index].cleanup)(curr->arg,
+ (*timeout_funcs[curr->func_index].cleanup)(&curr->arg,
curr->timeout);
free((genericptr_t) curr);
} else {
struct obj *object;
short timer_type;
{
- long timeout = peek_timer(timer_type, (genericptr_t)object);
+ long timeout = peek_timer(timer_type, obj_to_any(object));
return (boolean)(timeout != 0L);
}
for (prev = 0, curr = timer_base; curr; curr = next_timer) {
next_timer = curr->next;
if (curr->kind == TIMER_LEVEL &&
- curr->func_index == func_index && curr->arg == (genericptr_t)where) {
+ curr->func_index == func_index && curr->arg.a_long == where) {
if (prev)
prev->next = curr->next;
else
timer_base = curr->next;
if (timeout_funcs[curr->func_index].cleanup)
- (*timeout_funcs[curr->func_index].cleanup)(curr->arg,
+ (*timeout_funcs[curr->func_index].cleanup)(&curr->arg,
curr->timeout);
free((genericptr_t) curr);
} else {
for (curr = timer_base; curr; curr = curr->next) {
if (curr->kind == TIMER_LEVEL &&
- curr->func_index == func_index && curr->arg == (genericptr_t)where)
+ curr->func_index == func_index && curr->arg.a_long == where)
return curr->timeout;
}
return 0L;
remove_timer(base, func_index, arg)
timer_element **base;
short func_index;
-genericptr_t arg;
+anything *arg;
{
timer_element *prev, *curr;
for (prev = 0, curr = *base; curr; prev = curr, curr = curr->next)
- if (curr->func_index == func_index && curr->arg == arg) break;
+ if (curr->func_index == func_index && curr->arg.a_void == arg->a_void) break;
if (curr) {
if (prev)
int fd;
timer_element *timer;
{
- genericptr_t arg_save;
+ anything arg_save;
+
+ zero_anything(&arg_save);
switch (timer->kind) {
case TIMER_GLOBAL:
bwrite(fd, (genericptr_t)timer, sizeof(timer_element));
else {
/* replace object pointer with id */
- arg_save = timer->arg;
- timer->arg = (genericptr_t)((struct obj *)timer->arg)->o_id;
+ arg_save.a_obj = timer->arg.a_obj;
+ zero_anything(&timer->arg);
+ timer->arg.a_uint = (arg_save.a_obj)->o_id;
timer->needs_fixup = 1;
bwrite(fd, (genericptr_t)timer, sizeof(timer_element));
- timer->arg = arg_save;
+ timer->arg.a_obj = arg_save.a_obj;
timer->needs_fixup = 0;
}
break;
bwrite(fd, (genericptr_t)timer, sizeof(timer_element));
else {
/* replace monster pointer with id */
- arg_save = timer->arg;
- timer->arg = (genericptr_t)((struct monst *)timer->arg)->m_id;
+ arg_save.a_monst = timer->arg.a_monst;
+ zero_anything(&timer->arg);
+ timer->arg.a_uint = (arg_save.a_monst)->m_id;
timer->needs_fixup = 1;
bwrite(fd, (genericptr_t)timer, sizeof(timer_element));
- timer->arg = arg_save;
+ timer->arg.a_monst = arg_save.a_monst;
timer->needs_fixup = 0;
}
break;
switch (timer->kind) {
case TIMER_LEVEL: return TRUE;
case TIMER_GLOBAL: return FALSE;
- case TIMER_OBJECT: return obj_is_local((struct obj *)timer->arg);
- case TIMER_MONSTER: return mon_is_local((struct monst *)timer->arg);
+ case TIMER_OBJECT: return obj_is_local(timer->arg.a_obj);
+ case TIMER_MONSTER: return mon_is_local(timer->arg.a_monst);
}
panic("timer_is_local");
return FALSE;
if (curr->needs_fixup) {
if (curr->kind == TIMER_OBJECT) {
if (ghostly) {
- if (!lookup_id_mapping((unsigned)curr->arg, &nid))
+ if (!lookup_id_mapping(curr->arg.a_uint, &nid))
panic("relink_timers 1");
} else
- nid = (unsigned) curr->arg;
- curr->arg = (genericptr_t) find_oid(nid);
- if (!curr->arg) panic("cant find o_id %d", nid);
+ nid = curr->arg.a_uint;
+ curr->arg.a_obj = find_oid(nid);
+ if (!curr->arg.a_obj) panic("cant find o_id %d", nid);
curr->needs_fixup = 0;
} else if (curr->kind == TIMER_MONSTER) {
panic("relink_timers: no monster timer implemented");
for (when = MIN_ICE_TIME; when < (MAX_ICE_TIME + MIN_ICE_TIME); when++)
if (!rn2((MAX_ICE_TIME - when) + MIN_ICE_TIME)) break;
where = (((long)x << 16) | ((long)y));
- (void) start_timer((long)when, TIMER_LEVEL, action, (genericptr_t)where);
+ (void) start_timer((long)when, TIMER_LEVEL, action, long_to_any(where));
}
#undef MIN_ICE_TIME
#undef MAX_ICE_TIME
*/
void
melt_ice_away(arg, timeout)
-genericptr_t arg;
+anything *arg;
long timeout; /* unused */
{
xchar x,y;
- long where = (long)arg;
+ long where = arg->a_long;
y = (xchar)(where & 0xFFFF);
x = (xchar)((where >> 16) & 0xFFFF);