X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=init.c;h=89f9abb0e042623044bcd57e78aac719f14e4678;hb=2fac8d1aefb3526618ba0f1e7d25c7c7c81dddf4;hp=03a574f13eb5dd3f7126cfcdb7488d3131a240af;hpb=8a6e6aae7d289c4f7d5c419aba5f39f5eb74fb08;p=open-adventure.git diff --git a/init.c b/init.c index 03a574f..89f9abb 100644 --- a/init.c +++ b/init.c @@ -23,8 +23,8 @@ void initialise(void) for (int i = 1; i <= NLOCATIONS; i++) { game.abbrev[i] = 0; - if (!(locations[i].description.big == 0 || KEY[i] == 0)) { - int k = KEY[i]; + if (!(locations[i].description.big == 0 || TKEY[i] == 0)) { + int k = TKEY[i]; if (MOD(labs(TRAVEL[k]), 1000) == 1) conditions[i] |= (1 << COND_FORCED); } @@ -38,19 +38,18 @@ void initialise(void) * This also sets up "game.place" and "fixed" as copies of "PLAC" and * "FIXD". Also, since two-placed objects are typically best * described last, we'll drop them first. */ - for (int i = 1; i <= NOBJECTS; i++) { - int k = NOBJECTS + 1 - i; - if (object_descriptions[k].fixd > 0) { - DROP(k + NOBJECTS, object_descriptions[k].fixd); - DROP(k, object_descriptions[k].plac); + for (int i = NOBJECTS; i >= 1; i--) { + if (objects[i].fixd > 0) { + drop(i + NOBJECTS, objects[i].fixd); + drop(i, objects[i].plac); } } for (int i = 1; i <= NOBJECTS; i++) { int k = NOBJECTS + 1 - i; - game.fixed[k] = object_descriptions[k].fixd; - if (object_descriptions[k].plac != 0 && object_descriptions[k].fixd <= 0) - DROP(k, object_descriptions[k].plac); + game.fixed[k] = objects[k].fixd; + if (objects[k].plac != 0 && objects[k].fixd <= 0) + drop(k, objects[k].plac); } /* Treasure props are initially -1, and are set to 0 the first time @@ -58,8 +57,8 @@ void initialise(void) * not yet found, so we know when to close the cave. */ game.tally = 0; for (int treasure = 1; treasure <= NOBJECTS; treasure++) { - if (object_descriptions[treasure].is_treasure) { - if (object_descriptions[treasure].inventory != 0) + if (objects[treasure].is_treasure) { + if (objects[treasure].inventory != 0) game.prop[treasure] = -1; game.tally = game.tally - game.prop[treasure]; } @@ -192,7 +191,7 @@ void initialise(void) game.bonus = 0; game.clock1 = WARNTIME; game.clock2 = FLASHTIME; - game.conds = SETBIT(11); + game.conds = setbit(11); game.saved = 0; game.closng = false; game.panic = false;