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

@ -37,7 +37,9 @@ long score(enum termination mode)
/* First tally up the treasures. Must be in building and not broken.
* Give the poor guy 2 points just for finding each treasure. */
mxscor = 0;
for (long i = MINTRS; i <= MAXTRS; i++) {
for (int i = 1; i <= NOBJECTS; i++) {
if (!object_descriptions[i].is_treasure)
continue;
if (object_descriptions[i].inventory != 0) {
long k = 12;
if (i == CHEST)k = 14;