Added the ability to suppress newer features with a game type option.
[super-star-trek.git] / ai.c
diff --git a/ai.c b/ai.c
index 1e70f2a72c84f7865cdac3cf46ee27abf62d8c2c..a1b4bbf6f92ef101dc9ac53ed5a8b3af39f8fcde 100644 (file)
--- a/ai.c
+++ b/ai.c
@@ -151,7 +151,7 @@ static void movebaddy(int comx, int comy, int loccom, int ienm)
        else {
            if (forces > 1000.0) /* Very strong -- move in for kill */
                motion = (1.0-square(Rand()))*dist1 + 1.0;
-           if (condit==IHDOCKED) /* protected by base -- back off ! */
+           if (condit==IHDOCKED && (game.options & OPTION_BASE)) /* protected by base -- back off ! */
                motion -= skill*(2.0-square(Rand()));
        }
 #ifdef DEBUG
@@ -213,7 +213,7 @@ static void movebaddy(int comx, int comy, int loccom, int ienm)
                looky = nexty + krawly;
                krawly = -krawly;
            }
-           else if (game.quad[lookx][looky] != IHDOT) {
+           else if ((game.options & OPTION_RAMMING) && game.quad[lookx][looky] != IHDOT) {
                /* See if we should ram ship */
                if (game.quad[lookx][looky] == ship &&
                    (ienm == IHC || ienm == IHS)) {
@@ -294,12 +294,13 @@ void movcom(void)
     /* if skill level is high, move other Klingons and Romulans too!
        Move these last so they can base their actions on what the
        commander(s) do. */
-    if (skill >= SKILL_EXPERT) for_local_enemies(i) {
-       ix = game.kx[i];
-       iy = game.ky[i];
-       if (game.quad[ix][iy] == IHK || game.quad[ix][iy] == IHR)
-           movebaddy(ix, iy, i, game.quad[ix][iy]);
-    }
+    if (skill >= SKILL_EXPERT && (game.options & OPTION_MVBADDY)) 
+       for_local_enemies(i) {
+           ix = game.kx[i];
+           iy = game.ky[i];
+           if (game.quad[ix][iy] == IHK || game.quad[ix][iy] == IHR)
+               movebaddy(ix, iy, i, game.quad[ix][iy]);
+       }
 
     sortkl();
 }