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

Function maybe_write_timer

src/timeout.c:2626–2651  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2624 * be written. If write_it is true, actually write the timer.
2625 */
2626staticfn int
2627maybe_write_timer(NHFILE *nhfp, int range, boolean write_it)
2628{
2629 int count = 0;
2630 timer_element *curr;
2631
2632 for (curr = gt.timer_base; curr; curr = curr->next) {
2633 if (range == RANGE_GLOBAL) {
2634 /* global timers */
2635
2636 if (!timer_is_local(curr)) {
2637 count++;
2638 if (write_it) write_timer(nhfp, curr);
2639 }
2640 } else {
2641 /* local timers */
2642
2643 if (timer_is_local(curr)) {
2644 count++;
2645 if (write_it) write_timer(nhfp, curr);
2646 }
2647 }
2648 }
2649
2650 return count;
2651}
2652
2653
2654/*

Callers 1

save_timersFunction · 0.85

Calls 2

timer_is_localFunction · 0.85
write_timerFunction · 0.85

Tested by

no test coverage detected