* rest_worm() * * Restore the worm information from the save file. Called from restore.c */
| 574 | * Restore the worm information from the save file. Called from restore.c |
| 575 | */ |
| 576 | void |
| 577 | rest_worm(NHFILE *nhfp) |
| 578 | { |
| 579 | int i, j; |
| 580 | int count = 0; |
| 581 | struct wseg *curr, *temp; |
| 582 | |
| 583 | for (i = 1; i < MAX_NUM_WORMS; i++) { |
| 584 | Sfi_int(nhfp, &count, "worm-segment_count"); |
| 585 | |
| 586 | /* Get the segments. */ |
| 587 | for (curr = (struct wseg *) 0, j = 0; j < count; j++) { |
| 588 | temp = newseg(); |
| 589 | temp->nseg = (struct wseg *) 0; |
| 590 | Sfi_coordxy(nhfp, &(temp->wx), "worm-wx"); |
| 591 | Sfi_coordxy(nhfp, &(temp->wy), "worm-wy"); |
| 592 | if (curr) |
| 593 | curr->nseg = temp; |
| 594 | else |
| 595 | wtails[i] = temp; |
| 596 | curr = temp; |
| 597 | } |
| 598 | wheads[i] = curr; |
| 599 | } |
| 600 | for (i = 0; i < MAX_NUM_WORMS; ++i) { |
| 601 | Sfi_long(nhfp, &wgrowtime[i], "worm-wgrowtime"); |
| 602 | } |
| 603 | } |
| 604 | |
| 605 | #ifndef SFCTOOL |
| 606 | /* |