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

Function relink_timers

src/timeout.c:2747–2774  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2745}
2746
2747RESTORE_WARNING_FORMAT_NONLITERAL
2748
2749/* reset all timers that are marked for resetting */
2750void
2751relink_timers(boolean ghostly)
2752{
2753 timer_element *curr;
2754 unsigned nid;
2755
2756 for (curr = gt.timer_base; curr; curr = curr->next) {
2757 if (curr->needs_fixup) {
2758 if (curr->kind == TIMER_OBJECT) {
2759 if (ghostly) {
2760 if (!lookup_id_mapping(curr->arg.a_uint, &nid))
2761 panic("relink_timers 1");
2762 } else
2763 nid = curr->arg.a_uint;
2764 curr->arg.a_obj = find_oid(nid);
2765 if (!curr->arg.a_obj)
2766 panic("can't find o_id %d", nid);
2767 curr->needs_fixup = 0;
2768 } else if (curr->kind == TIMER_MONSTER) {
2769 panic("relink_timers: no monster timer implemented");
2770 } else
2771 panic("relink_timers 2");
2772 }
2773 }
2774}
2775#endif /* !SFCTOOL */
2776
2777/*timeout.c*/

Callers 2

restgamestateFunction · 0.85
getlevFunction · 0.85

Calls 3

lookup_id_mappingFunction · 0.85
find_oidFunction · 0.85
panicFunction · 0.50

Tested by

no test coverage detected