ice Warning (trunk only)

This commit is contained in:
nethack.allison
2003-10-13 23:54:41 +00:00
parent bf98bc9fe8
commit 84f667c5a4
4 changed files with 44 additions and 0 deletions

View File

@@ -1585,6 +1585,34 @@ short func_index;
}
}
/*
* When is the spot timer of type func_index going to expire?
* Returns 0L if no such timer.
*/
long
spot_time_expires(x,y,func_index)
xchar x,y;
short func_index;
{
timer_element *curr;
long where = (((long)x << 16) | ((long)y));
for (curr = timer_base; curr; curr = curr->next) {
if (curr->kind == TIMER_LEVEL &&
curr->func_index == func_index && curr->arg == (genericptr_t)where)
return curr->timeout;
}
return 0L;
}
long
spot_time_left(x,y,func_index)
xchar x,y;
short func_index;
{
long expires = spot_time_expires(x,y,func_index);
return (expires > 0L) ? expires - monstermoves : 0L;
}
/* Insert timer into the global queue */
STATIC_OVL void