* Pull in the structures from disk, but don't recalculate the object and * monster pointers. */
| 2704 | * monster pointers. |
| 2705 | */ |
| 2706 | void |
| 2707 | restore_timers(NHFILE *nhfp, int range, long adjust) |
| 2708 | { |
| 2709 | int count = 0; |
| 2710 | timer_element *curr; |
| 2711 | boolean ghostly = (nhfp->ftype == NHF_BONESFILE); /* from a ghost level */ |
| 2712 | |
| 2713 | if (range == RANGE_GLOBAL) { |
| 2714 | Sfi_ulong(nhfp, &svt.timer_id, "timer-timer_id"); |
| 2715 | } |
| 2716 | |
| 2717 | /* restore elements */ |
| 2718 | Sfi_int(nhfp, &count, "timer-timer_count"); |
| 2719 | while (count-- > 0) { |
| 2720 | curr = (timer_element *) alloc(sizeof(timer_element)); |
| 2721 | Sfi_fe(nhfp, curr, "timer"); |
| 2722 | if (ghostly) |
| 2723 | curr->timeout += adjust; |
| 2724 | #ifndef SFCTOOL |
| 2725 | insert_timer(curr); |
| 2726 | #endif |
| 2727 | } |
| 2728 | } |
| 2729 | |
| 2730 | #ifndef SFCTOOL |
| 2731 | DISABLE_WARNING_FORMAT_NONLITERAL |
no test coverage detected