X-Git-Url: https://jxself.org/git/?p=open-adventure.git;a=blobdiff_plain;f=main.c;h=37461f7e44d6afd28f5a0998a01e2200be0f53e8;hp=db27b16a6a8496726e6db9298e06fcbc4985e70b;hb=49d9ef1bee7b11055b7a46e2c2b45bd888e1ccef;hpb=761d660cd260f7d8605d64ccdc06f35cb0eb7e18 diff --git a/main.c b/main.c index db27b16..37461f7 100644 --- a/main.c +++ b/main.c @@ -540,40 +540,39 @@ static void playermove( int motion) motion = game.oldlc2; game.oldlc2 = game.oldloc; game.oldloc = game.loc; - int spk = 0; - if (motion == game.loc) - spk = FORGOT_PATH; - if (CNDBIT(game.loc, COND_NOBACK)) - spk = TWIST_TURN; - if (spk == 0) { - int te_tmp = 0; - for (;;) { - enum desttype_t desttype = travel[travel_entry].desttype; - scratchloc = travel[travel_entry].destval; - if (desttype != dest_goto || scratchloc != motion) { - if (desttype == dest_goto) { - if (FORCED(scratchloc) && travel[tkey[scratchloc]].destval == motion) - te_tmp = travel_entry; - } - if (!travel[travel_entry].stop) { - ++travel_entry; /* go to next travel entry for this location */ - continue; - } - /* we've reached the end of travel entries for game.loc */ - travel_entry = te_tmp; - if (travel_entry == 0) { - rspeak(NOT_CONNECTED); - return; - } - } + if (CNDBIT(game.loc, COND_NOBACK)) { + rspeak(TWIST_TURN); + return; + } + if (motion == game.loc) { + rspeak(FORGOT_PATH); + return; + } - motion = travel[travel_entry].motion; - travel_entry = tkey[game.loc]; - break; /* fall through to ordinary travel */ + int te_tmp = 0; + for (;;) { + enum desttype_t desttype = travel[travel_entry].desttype; + scratchloc = travel[travel_entry].destval; + if (desttype != dest_goto || scratchloc != motion) { + if (desttype == dest_goto) { + if (FORCED(scratchloc) && travel[tkey[scratchloc]].destval == motion) + te_tmp = travel_entry; + } + if (!travel[travel_entry].stop) { + ++travel_entry; /* go to next travel entry for this location */ + continue; + } + /* we've reached the end of travel entries for game.loc */ + travel_entry = te_tmp; + if (travel_entry == 0) { + rspeak(NOT_CONNECTED); + return; + } } - } else { - rspeak(spk); - return; + + motion = travel[travel_entry].motion; + travel_entry = tkey[game.loc]; + break; /* fall through to ordinary travel */ } } else if (motion == LOOK) { /* Look. Can't give more detail. Pretend it wasn't dark