X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=src%2Fplanets.c;h=47140ea9df814282fad4db38d9556055864b9f4b;hb=d48a2567098e4d756e0ca9d4b707bcd5867ac6c9;hp=723e5e9a7ab92e24d6a8360076fa6010a1142bcc;hpb=c81e0f1dc6cd1fe5c56e9d521ee1d262932e3a2b;p=super-star-trek.git diff --git a/src/planets.c b/src/planets.c index 723e5e9..47140ea 100644 --- a/src/planets.c +++ b/src/planets.c @@ -27,7 +27,8 @@ static int consumeTime(void) void preport(void) { - int iknow = 0, i; + bool iknow = false; + int i; skip(1); chew(); prout("Spock- \"Planet report follows, Captain.\""); @@ -35,14 +36,11 @@ void preport(void) for (i = 0; i < game.inplan; i++) { if ((game.state.plnets[i].known != unknown && game.state.plnets[i].crystals != 0) -#ifdef DEBUG - || ( game.idebug && game.state.plnets[i].x !=0) -#endif + || (idebug && game.state.plnets[i].w.x !=0) ) { - iknow = 1; -#ifdef DEBUG - if (game.idebug && game.state.plnets[i].known==unknown) proutn("(Unknown) "); -#endif + iknow = true; + if (idebug && game.state.plnets[i].known==unknown) + proutn("(Unknown) "); proutn(cramlc(quadrant, game.state.plnets[i].w)); proutn(" class "); proutn(classes[game.state.plnets[i].pclass]); @@ -60,7 +58,7 @@ void orbit(void) { skip(1); chew(); - if (game.inorbit!=0) { + if (game.inorbit) { prout("Already in standard orbit."); return; } @@ -80,8 +78,8 @@ void orbit(void) if (consumeTime()) return; game.height = (1400.0+7200.0*Rand()); prout("Sulu- \"Entered orbit at altitude %.2f kilometers.\"", game.height); - game.inorbit = 1; - game.ididit=1; + game.inorbit = true; + game.ididit = true; } void sensor(void) @@ -124,7 +122,7 @@ void beam(void) } return; } - if (game.inorbit==0) { + if (!game.inorbit) { crmshp(); prout(" not in standard orbit."); return; @@ -301,7 +299,7 @@ void shuttle(void) else prout("Shuttle craft is now serving Big Macs."); return; } - if (game.inorbit==0) { + if (!game.inorbit) { crmshp(); prout(" not in standard orbit."); return; @@ -443,7 +441,7 @@ void deathray(void) prouts("Sulu- \"Captain! It's working!\""); skip(2); while (game.nenhere > 0) - deadkl(game.ks[1].x,game.ks[1].y,game.quad[game.ks[1].x][game.ks[1].y],game.ks[1].x,game.ks[1].y); + deadkl(game.ks[1], game.quad[game.ks[1].x][game.ks[1].y],game.ks[1].x,game.ks[1].y); prout("Ensign Chekov- \"Congratulations, Captain!\""); if (KLINGREM == 0) finish(FWON); if ((game.options & OPTION_PLAIN) == 0) { @@ -511,7 +509,7 @@ void deathray(void) return; } -char *systemname(planet *planet) +char *systemname(int pindx) { static char *names[NINHAB] = { @@ -584,5 +582,5 @@ char *systemname(planet *planet) "Exo III", /* TOS: "What Are Little Girls Made Of?" (Class P) */ }; - return names[planet->inhabited]; + return names[pindx]; }