… | |
… | |
398 | LOG (llevDebug, "createtreasure: tries exceeded 100, returning without making treasure\n"); |
398 | LOG (llevDebug, "createtreasure: tries exceeded 100, returning without making treasure\n"); |
399 | return; |
399 | return; |
400 | } |
400 | } |
401 | |
401 | |
402 | if (op->flag [FLAG_TREASURE_ENV]) |
402 | if (op->flag [FLAG_TREASURE_ENV]) |
|
|
403 | { |
|
|
404 | // do not generate items when there already is something above the object |
|
|
405 | if (op->flag [FLAG_IS_FLOOR] && op->above) |
|
|
406 | return; |
|
|
407 | |
403 | flag |= GT_ENVIRONMENT; |
408 | flag |= GT_ENVIRONMENT; |
|
|
409 | } |
404 | |
410 | |
405 | if (tl->total_chance) |
411 | if (tl->total_chance) |
406 | create_one_treasure (tl, op, flag, difficulty, tries); |
412 | create_one_treasure (tl, op, flag, difficulty, tries); |
407 | else |
413 | else |
408 | create_all_treasures (tl->items, op, flag, difficulty, tries); |
414 | create_all_treasures (tl->items, op, flag, difficulty, tries); |