… | |
… | |
194 | return; |
194 | return; |
195 | } |
195 | } |
196 | while (fgets (buf, MAX_BUF, fp) != NULL) |
196 | while (fgets (buf, MAX_BUF, fp) != NULL) |
197 | { |
197 | { |
198 | line++; |
198 | line++; |
199 | if (*buf == '#') |
199 | if (*buf == '#' || *buf == '\n') |
200 | continue; |
200 | ; // ignore |
201 | |
|
|
202 | if (sscanf (buf, "treasureone %s\n", name) || sscanf (buf, "treasure %s\n", name)) |
201 | else if (sscanf (buf, "treasureone %s\n", name) || sscanf (buf, "treasure %s\n", name)) |
203 | { |
202 | { |
204 | treasurelist *tl = get_empty_treasurelist (); |
203 | treasurelist *tl = get_empty_treasurelist (); |
205 | |
204 | |
206 | tl->name = name; |
205 | tl->name = name; |
207 | if (previous == NULL) |
206 | if (previous == NULL) |
208 | first_treasurelist = tl; |
207 | first_treasurelist = tl; |
209 | else |
208 | else |
210 | previous->next = tl; |
209 | previous->next = tl; |
|
|
210 | |
211 | previous = tl; |
211 | previous = tl; |
212 | tl->items = load_treasure (fp, &line); |
212 | tl->items = load_treasure (fp, &line); |
213 | |
213 | |
214 | /* This is a one of the many items on the list should be generated. |
214 | /* This is a one of the many items on the list should be generated. |
215 | * Add up the chance total, and check to make sure the yes & no |
215 | * Add up the chance total, and check to make sure the yes & no |