… | |
… | |
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 |
… | |
… | |
1343 | */ |
1343 | */ |
1344 | void |
1344 | void |
1345 | init_artifacts (void) |
1345 | init_artifacts (void) |
1346 | { |
1346 | { |
1347 | static int has_been_inited = 0; |
1347 | static int has_been_inited = 0; |
1348 | char filename[MAX_BUF], buf[HUGE_BUF], *cp, *next; |
1348 | char filename[MAX_BUF]; |
1349 | artifact *art = NULL; |
1349 | artifact *art = NULL; |
1350 | int value; |
|
|
1351 | artifactlist *al; |
1350 | artifactlist *al; |
1352 | |
1351 | |
1353 | if (has_been_inited) |
1352 | if (has_been_inited) |
1354 | return; |
1353 | return; |
1355 | else |
1354 | else |