X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=main.c;h=a36ffce8d3f78e1f1117fb4af17e65701c005459;hb=f6267ff3eb635c3494b8a67e967bb2882a0f9875;hp=dd202357ba7004073ce1c51290c74110dbb1ac76;hpb=aace0b1359f15195820bf6d22a897f7c332c5eab;p=open-adventure.git diff --git a/main.c b/main.c index dd20235..a36ffce 100644 --- a/main.c +++ b/main.c @@ -414,7 +414,7 @@ static bool dwarfmove(void) } ++kk; } while - (!T_STOP(travel[kk - 1])); + (!travel[kk - 1].stop); tk[j] = game.odloc[i]; if (j >= 2) --j; @@ -544,7 +544,7 @@ static bool playermove(token_t verb, int motion) if (FORCED(scratchloc) && T_DESTINATION(travel[tkey[scratchloc]]) == motion) k2 = kk; } - if (!T_STOP(travel[kk])) { + if (!travel[kk].stop) { ++kk; /* go to next travel entry for this location */ continue; } @@ -556,7 +556,7 @@ static bool playermove(token_t verb, int motion) } } - motion = T_MOTION(travel[kk]); + motion = travel[kk].motion; kk = tkey[game.loc]; break; /* fall through to ordinary travel */ } @@ -584,12 +584,12 @@ static bool playermove(token_t verb, int motion) game.oldloc = game.loc; } - /* Look for a way to fulfil the motion - kk indexes the beginning - * of the motion entries for here (game.loc). */ + /* Look for a way to fulfil the motion verb passed in - kk indexes + * the beginning of the motion entries for here (game.loc). */ for (;;) { - if (T_TERMINATE(travel[kk]) || T_MOTION(travel[kk]) == motion) + if (T_TERMINATE(travel[kk]) || travel[kk].motion == motion) break; - if (T_STOP(travel[kk])) { + if (travel[kk].stop) { /* FIXME: Magic numbers! */ /* Couldn't find an entry matching the motion word passed * in. Various messages depending on word given. */ @@ -598,7 +598,7 @@ static bool playermove(token_t verb, int motion) if (motion == 29 || motion == 30)spk = BAD_DIRECTION; if (motion == 7 || motion == 36 || motion == 37)spk = UNSURE_FACING; if (motion == 11 || motion == 19)spk = NO_INOUT_HERE; - if (verb == FIND || verb == INVENT)spk = NEARBY; + if (verb == FIND || verb == INVENTORY)spk = NEARBY; if (motion == 62 || motion == 65)spk = NOTHING_HAPPENS; if (motion == 17)spk = WHICH_WAY; rspeak(spk); @@ -606,14 +606,18 @@ static bool playermove(token_t verb, int motion) } ++kk; } + + /* (ESR) We've found a destination that goes with the motion verb. + * Next we need to check any conditional(s) on this destination, and + * possibly on following entries. */ scratchloc = T_HIGH(travel[kk]); do { /* - * (ESR) This special-travel loop may have to be repeated if it includes - * the plover passage. Same deal for any future cases where we need to - * block travel and then redo it once the blocking condition has been - * removed. + * (ESR) This conditional-skip loop may have to be repeated if + * it includes the plover passage. Same deal for any future + * cases where we need to block travel and then redo it once + * the blocking condition has been removed. */ for (;;) { /* L12 loop */ for (;;) { @@ -632,7 +636,7 @@ static bool playermove(token_t verb, int motion) } else if (game.prop[motion] != game.newloc / 100 - 3) break; do { - if (T_STOP(travel[kk])) + if (travel[kk].stop) BUG(CONDITIONAL_TRAVEL_ENTRY_WITH_NO_ALTERATION); ++kk; game.newloc = T_HIGH(travel[kk]); @@ -673,7 +677,7 @@ static bool playermove(token_t verb, int motion) * pretend he wasn't carrying it after all. */ drop(EMERALD, game.loc); do { - if (T_STOP(travel[kk])) + if (travel[kk].stop) BUG(CONDITIONAL_TRAVEL_ENTRY_WITH_NO_ALTERATION); ++kk; game.newloc = T_HIGH(travel[kk]);