More int-to-boolean cleanup. Make the FDISTR event work.
[super-star-trek.git] / src / ai.c
index 685fe69947d77f8547c34450966ed4dfe6929480..9e6c31095e737b16d4cc08744b0a63b177af5b6d 100644 (file)
--- a/src/ai.c
+++ b/src/ai.c
@@ -130,7 +130,7 @@ static void movebaddy(coord com, int loccom, int ienm)
  */
 
        forces = game.kpower[loccom]+100.0*game.nenhere+400*(nbaddys-1);
-       if (game.shldup==0) forces += 1000; /* Good for enemy if shield is down! */
+       if (!game.shldup) forces += 1000; /* Good for enemy if shield is down! */
        if (game.damage[DPHASER] == 0.0 || game.damage[DPHOTON] == 0.0) {
            if (game.damage[DPHASER] != 0) /* phasers damaged */
                forces += 300.0;
@@ -334,7 +334,7 @@ static bool movescom(coord iq, int flag, int *ipage)
            game.state.plnets[i].crystals == 1) {
            /* destroy the planet */
            DESTROY(&game.state.plnets[i]);
-           game.state.galaxy[game.state.kscmdr.x][game.state.kscmdr.y].planet = NULL;
+           game.state.galaxy[game.state.kscmdr.x][game.state.kscmdr.y].planet = NOPLANET;
            if (game.damage[DRADIO] == 0.0 || game.condit == IHDOCKED) {
                if (*ipage==0) pause_game(1);
                *ipage = 1;
@@ -500,10 +500,10 @@ void scom(int *ipage)
            prout(_("   reports that it is under attack from the Klingon Super-commander."));
            proutn(_("   It can survive until stardate %d.\""),
                   (int)scheduled(FSCDBAS));
-           if (game.resting==0) return;
+           if (!game.resting) return;
            prout(_("Mr. Spock-  \"Captain, shall we cancel the rest period?\""));
            if (ja()==0) return;
-           game.resting = 0;
+           game.resting = false;
            game.optime = 0.0; /* actually finished */
            return;
        }