X-Git-Url: https://jxself.org/git/?p=open-adventure.git;a=blobdiff_plain;f=init.c;h=b19e422fd5a9dc7dd5033ba985ec8048d32b957f;hp=b7c0249db649c6da3e40ea6d3618c4d247da4a2c;hb=c3a2816821512b59a09866a594a9bec699193271;hpb=64035d00262d3b10c126748be659d22394b7ed3b diff --git a/init.c b/init.c index b7c0249..b19e422 100644 --- a/init.c +++ b/init.c @@ -167,7 +167,7 @@ void initialise(void) game.link[i + NOBJECTS] = game.link[i] = 0; } - for (int i = 1; i <= LOCSIZ; i++) { + for (int i = 1; i <= NLOCATIONS; i++) { game.abbrev[i] = 0; if (!(locations[i].description.big == 0 || KEY[i] == 0)) { int k = KEY[i]; @@ -199,15 +199,16 @@ void initialise(void) DROP(k, PLAC[k]); } - /* Treasures, as noted earlier, are objects MINTRS through MAXTRS - * Their props are initially -1, and are set to 0 the first time + /* Treasure props are initially -1, and are set to 0 the first time * they are described. game.tally keeps track of how many are * not yet found, so we know when to close the cave. */ game.tally = 0; - for (int treasure = MINTRS; treasure <= MAXTRS; treasure++) { - if (object_descriptions[treasure].inventory != 0) - game.prop[treasure] = -1; - game.tally = game.tally - game.prop[treasure]; + for (int treasure = 1; treasure <= NOBJECTS; treasure++) { + if (object_descriptions[treasure].is_treasure) { + if (object_descriptions[treasure].inventory != 0) + game.prop[treasure] = -1; + game.tally = game.tally - game.prop[treasure]; + } } /* Clear the hint stuff. game.hintlc[i] is how long he's been at LOC @@ -260,7 +261,7 @@ void initialise(void) VOLCANO = VOCWRD(WORD_VOLCANO, 1); WATER = VOCWRD(WORD_WATER, 1); - /* Objects from MINTRS through MAXTRS are treasures. Here are a few. */ + /* Vocabulary for treasures */ AMBER = VOCWRD(WORD_AMBER, 1); CHAIN = VOCWRD(WORD_CHAIN, 1); CHEST = VOCWRD(WORD_CHEST, 1);