save all the fruit names and ID's; this is used only in saving whole games * (not levels) and in saving bones levels. When saving a bones level, * we only want to save the fruits which exist on the bones level; the bones * level routine marks nonexistent fruits by making the fid negative. */
| 948 | * level routine marks nonexistent fruits by making the fid negative. |
| 949 | */ |
| 950 | void |
| 951 | savefruitchn(NHFILE *nhfp) |
| 952 | { |
| 953 | static struct fruit zerofruit; |
| 954 | struct fruit *f2, *f1; |
| 955 | |
| 956 | f1 = gf.ffruit; |
| 957 | while (f1) { |
| 958 | f2 = f1->nextf; |
| 959 | if (f1->fid >= 0 && update_file(nhfp)) { |
| 960 | Sfo_fruit(nhfp, f1, "fruit"); |
| 961 | } |
| 962 | if (release_data(nhfp)) |
| 963 | dealloc_fruit(f1); |
| 964 | f1 = f2; |
| 965 | } |
| 966 | if (update_file(nhfp)) { |
| 967 | Sfo_fruit(nhfp, &zerofruit, "fruit"); |
| 968 | } |
| 969 | if (release_data(nhfp)) |
| 970 | gf.ffruit = 0; |
| 971 | } |
| 972 | |
| 973 | staticfn void |
| 974 | savelevchn(NHFILE *nhfp) |
no test coverage detected