… | |
… | |
448 | * it instead takes a treasurelist. It is really just a wrapper around |
448 | * it instead takes a treasurelist. It is really just a wrapper around |
449 | * create_treasure. We create a dummy object that the treasure gets |
449 | * create_treasure. We create a dummy object that the treasure gets |
450 | * inserted into, and then return that treausre |
450 | * inserted into, and then return that treausre |
451 | */ |
451 | */ |
452 | object * |
452 | object * |
453 | generate_treasure (treasurelist * t, int difficulty) |
453 | generate_treasure (treasurelist *t, int difficulty) |
454 | { |
454 | { |
|
|
455 | difficulty = clamp (difficulty, 1, settings.max_level); |
|
|
456 | |
455 | object *ob = object::create (), *tmp; |
457 | object *ob = object::create (), *tmp; |
456 | |
458 | |
457 | create_treasure (t, ob, 0, difficulty, 0); |
459 | create_treasure (t, ob, 0, difficulty, 0); |
458 | |
460 | |
459 | /* Don't want to free the object we are about to return */ |
461 | /* Don't want to free the object we are about to return */ |