X-Git-Url: https://jxself.org/git/?p=open-adventure.git;a=blobdiff_plain;f=main.c;h=75cdf371229852fda434b5ed43f0fee0e05ca20a;hp=8f98db577ec1d199292cbb5649149392878ceacf;hb=7281c398071dc61b28a9251f2044315eba5394ea;hpb=6150e3be1fdc8d55ff79f87c014a62a134559799 diff --git a/main.c b/main.c index 8f98db5..75cdf37 100644 --- a/main.c +++ b/main.c @@ -625,20 +625,24 @@ static bool playermove(token_t verb, int motion) for (;;) { /* L12 loop */ for (;;) { game.newloc = scratchloc / 1000; - motion = MOD(game.newloc, 100); + long arg = MOD(game.newloc, 100); if (!SPECIAL(game.newloc)) { + /* YAML N and [pct N] conditionals */ if (game.newloc <= 100) { if (game.newloc == 0 || PCT(game.newloc)) break; /* else fall through */ } - /* handles the YAML "with" clause */ - if (TOTING(motion) || (game.newloc > 200 && AT(motion))) + /* YAML [with OBJ] clause */ + if (TOTING(arg) || (game.newloc > 200 && AT(arg))) break; - /* else fall through */ - } else if (game.prop[motion] != game.newloc / 100 - 3) + /* else fall through to check [not OBJ STATE] */ + } else if (game.prop[arg] != game.newloc / 100 - 3) break; - do { + + /* We arrive here on conditional failure. + * Skip to next non-matching destination */ + do { if (travel[kk].stop) BUG(CONDITIONAL_TRAVEL_ENTRY_WITH_NO_ALTERATION); // LCOV_EXCL_LINE ++kk;