/* calcuate preferred number of steps */
nsteps = motion < 0 ? -motion : motion;
if (motion > 0 && nsteps > mdist) nsteps = mdist; /* don't overshoot */
/* calcuate preferred number of steps */
nsteps = motion < 0 ? -motion : motion;
if (motion > 0 && nsteps > mdist) nsteps = mdist; /* don't overshoot */
if (motion < 0 && tryexit(lookx, looky, ienm, loccom, irun))
return;
if (krawlx == mx || my == 0) break;
lookx = nextx + krawlx;
krawlx = -krawlx;
}
if (motion < 0 && tryexit(lookx, looky, ienm, loccom, irun))
return;
if (krawlx == mx || my == 0) break;
lookx = nextx + krawlx;
krawlx = -krawlx;
}
if (motion < 0 && tryexit(lookx, looky, ienm, loccom, irun))
return;
if (krawly == my || mx == 0) break;
if (motion < 0 && tryexit(lookx, looky, ienm, loccom, irun))
return;
if (krawly == my || mx == 0) break;
/* check to see if all holes plugged */
for (i = 1; i < 11; i++) {
if (game.quad[1][i]!=IHWEB && game.quad[1][i]!=IHT) return;
/* check to see if all holes plugged */
for (i = 1; i < 11; i++) {
if (game.quad[1][i]!=IHWEB && game.quad[1][i]!=IHT) return;