Replace magic MINTRS/MAXTRS with a treasure attribute in YAML.

This commit is contained in:
Eric S. Raymond 2017-06-24 10:42:23 -04:00
parent 25077d0b4e
commit c3a2816821
7 changed files with 43 additions and 107 deletions

View file

@ -899,7 +899,7 @@ static int throw (FILE *cmdin, struct command_t *command)
rspeak(spk);
return GO_CLEAROBJ;
}
if (command->obj >= MINTRS && command->obj <= MAXTRS && AT(TROLL)) {
if (object_descriptions[command->obj].is_treasure && AT(TROLL)) {
spk = TROLL_SATISFIED;
/* Snarf a treasure for the troll. */
DROP(command->obj, 0);