MCPcopy Create free account
hub / github.com/NetHack/NetHack / obj_move_timers

Function obj_move_timers

src/timeout.c:2338–2353  ·  view source on GitHub ↗

* Move all object timers from src to dest, leaving src untimed. */

Source from the content-addressed store, hash-verified

2336 * Move all object timers from src to dest, leaving src untimed.
2337 */
2338void
2339obj_move_timers(struct obj *src, struct obj *dest)
2340{
2341 int count;
2342 timer_element *curr;
2343
2344 for (count = 0, curr = gt.timer_base; curr; curr = curr->next)
2345 if (curr->kind == TIMER_OBJECT && curr->arg.a_obj == src) {
2346 curr->arg.a_obj = dest;
2347 dest->timed++;
2348 count++;
2349 }
2350 if (count != src->timed)
2351 panic("obj_move_timers");
2352 src->timed = 0;
2353}
2354
2355/*
2356 * Find all object timers and duplicate them for the new object "dest".

Callers

nothing calls this directly

Calls 1

panicFunction · 0.50

Tested by

no test coverage detected