X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=src%2Fmoving.c;h=e966bed76a47899bb6633828656301df8f619ee3;hb=3590a3f873652e8e718ebe3898c913cdf6b36d1c;hp=42df8c1ea6e45002da883757e72adaaf6b7f1475;hpb=c8f91a7e3437017d237a3bad0166054b97206d8d;p=super-star-trek.git diff --git a/src/moving.c b/src/moving.c index 42df8c1..e966bed 100644 --- a/src/moving.c +++ b/src/moving.c @@ -489,12 +489,12 @@ void impuls(void) } -void warp(int i) +void warp(bool timewarp) { int blooey=0, twarp=0, iwarp; double power; - if (i!=2) { /* Not WARPX entry */ + if (!timewarp) { /* Not WARPX entry */ game.ididit = 0; if (game.damage[DWARPEN] > 10.0) { chew(); @@ -523,7 +523,7 @@ void warp(int i) game.ididit = 0; skip(1); prout("Engineering to bridge--"); - if (game.shldup==0 || 0.5*power > game.energy) { + if (!game.shldup || 0.5*power > game.energy) { iwarp = pow((game.energy/(game.dist+0.05)), 0.333333333); if (iwarp <= 0) { prout("We can't do it, Captain. We haven't the energy."); @@ -565,13 +565,11 @@ void warp(int i) } /* Decide if time warp will occur */ if (0.5*game.dist*pow(7.0,game.warpfac-10.0) > Rand()) twarp=1; -#ifdef DEBUG - if (game.idebug &&game.warpfac==10 && twarp==0) { + if (idebug && game.warpfac==10 && twarp==0) { blooey=0; - proutn("Force time warp? "); + proutn("=== Force time warp? "); if (ja()==1) twarp=1; } -#endif if (blooey || twarp) { /* If time warp or engine damage, check path */ /* If it is obstructed, don't do warp or damage */ @@ -751,10 +749,10 @@ void atover(int igrab) if (distreq < game.dist) game.dist = distreq; game.optime = 10.0*game.dist/game.wfacsq; game.direc = 12.0*Rand(); /* How dumb! */ - game.justin = 0; - game.inorbit = 0; - warp(2); - if (game.justin == 0) { + game.justin = false; + game.inorbit = false; + warp(true); + if (!game.justin) { /* This is bad news, we didn't leave quadrant. */ if (game.alldone) return; skip(1);