… | |
… | |
258 | shstr_cmp name_ (name); |
258 | shstr_cmp name_ (name); |
259 | |
259 | |
260 | if (!name_) |
260 | if (!name_) |
261 | return 0; |
261 | return 0; |
262 | |
262 | |
263 | for (treasurelist * tl = first_treasurelist; tl != 0; tl = tl->next) |
263 | for (treasurelist *tl = first_treasurelist; tl != 0; tl = tl->next) |
264 | if (name_ == tl->name) |
264 | if (name_ == tl->name) |
265 | return tl; |
265 | return tl; |
266 | |
266 | |
267 | if (first_treasurelist) |
267 | if (first_treasurelist) |
268 | LOG (llevError, "Couldn't find treasurelist %s\n", name); |
268 | LOG (llevError, "Couldn't find treasurelist %s\n", name); |
… | |
… | |
339 | if ((int) t->chance >= 100 || (RANDOM () % 100 + 1) < (int) t->chance) |
339 | if ((int) t->chance >= 100 || (RANDOM () % 100 + 1) < (int) t->chance) |
340 | { |
340 | { |
341 | if (t->name) |
341 | if (t->name) |
342 | { |
342 | { |
343 | if (strcmp (t->name, "NONE") && difficulty >= t->magic) |
343 | if (strcmp (t->name, "NONE") && difficulty >= t->magic) |
|
|
344 | { |
|
|
345 | treasurelist *tl = find_treasurelist (t->name); |
|
|
346 | if (tl) |
344 | create_treasure (find_treasurelist (t->name), op, flag, difficulty, tries); |
347 | create_treasure (tl, op, flag, difficulty, tries); |
|
|
348 | } |
345 | } |
349 | } |
346 | else |
350 | else |
347 | { |
351 | { |
348 | if (t->item->clone.invisible != 0 || !(flag & GT_INVISIBLE)) |
352 | if (t->item->clone.invisible != 0 || !(flag & GT_INVISIBLE)) |
349 | { |
353 | { |
… | |
… | |
397 | { |
401 | { |
398 | if (!strcmp (t->name, "NONE")) |
402 | if (!strcmp (t->name, "NONE")) |
399 | return; |
403 | return; |
400 | |
404 | |
401 | if (difficulty >= t->magic) |
405 | if (difficulty >= t->magic) |
|
|
406 | { |
|
|
407 | treasurelist *tl = find_treasurelist (t->name); |
|
|
408 | if (tl) |
402 | create_treasure (find_treasurelist (t->name), op, flag, difficulty, tries); |
409 | create_treasure (tl, op, flag, difficulty, tries); |
|
|
410 | } |
403 | else if (t->nrof) |
411 | else if (t->nrof) |
404 | create_one_treasure (tl, op, flag, difficulty, tries); |
412 | create_one_treasure (tl, op, flag, difficulty, tries); |
405 | |
413 | |
406 | return; |
414 | return; |
407 | } |
415 | } |
… | |
… | |
1264 | { |
1272 | { |
1265 | for (i = 0; i < depth; i++) |
1273 | for (i = 0; i < depth; i++) |
1266 | fprintf (logfile, " "); |
1274 | fprintf (logfile, " "); |
1267 | fprintf (logfile, "{ (list: %s)\n", &t->name); |
1275 | fprintf (logfile, "{ (list: %s)\n", &t->name); |
1268 | tl = find_treasurelist (t->name); |
1276 | tl = find_treasurelist (t->name); |
|
|
1277 | if (tl) |
1269 | dump_monster_treasure_rec (name, tl->items, depth + 2); |
1278 | dump_monster_treasure_rec (name, tl->items, depth + 2); |
1270 | for (i = 0; i < depth; i++) |
1279 | for (i = 0; i < depth; i++) |
1271 | fprintf (logfile, " "); |
1280 | fprintf (logfile, " "); |
1272 | fprintf (logfile, "} (end of list: %s)\n", &t->name); |
1281 | fprintf (logfile, "} (end of list: %s)\n", &t->name); |
1273 | } |
1282 | } |
1274 | else |
1283 | else |