Author: cazfi
Date: Sun Dec 14 20:30:03 2014
New Revision: 27304

URL: http://svn.gna.org/viewcvs/freeciv?rev=27304&view=rev
Log:
Experimental AI level is available in --enable-debug builds only.

See patch #5466

Modified:
    trunk/ai/difficulty.c
    trunk/common/fc_types.h
    trunk/server/commands.c
    trunk/server/commands.h
    trunk/server/savecompat.c
    trunk/server/stdinhand.c

Modified: trunk/ai/difficulty.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/ai/difficulty.c?rev=27304&r1=27303&r2=27304&view=diff
==============================================================================
--- trunk/ai/difficulty.c       (original)
+++ trunk/ai/difficulty.c       Sun Dec 14 20:30:03 2014
@@ -95,9 +95,13 @@
      BV_SET(handicap, H_HUTS);
      BV_SET(handicap, H_DIPLOMAT);
      break;
+
+#ifdef DEBUG
    case AI_LEVEL_EXPERIMENTAL:
      BV_SET(handicap, H_EXPERIMENTAL);
      break;
+#endif /* DEBUG */
+
    case AI_LEVEL_CHEATING:
      BV_SET(handicap, H_RATES);
      break;
@@ -131,7 +135,9 @@
   case AI_LEVEL_NORMAL:
   case AI_LEVEL_HARD:
   case AI_LEVEL_CHEATING:
+#ifdef DEBUG
   case AI_LEVEL_EXPERIMENTAL:
+#endif /* DEBUG */
     return 0;
   case AI_LEVEL_COUNT:
     fc_assert(level != AI_LEVEL_COUNT);
@@ -162,7 +168,9 @@
   case AI_LEVEL_NORMAL:
   case AI_LEVEL_HARD:
   case AI_LEVEL_CHEATING:
+#ifdef DEBUG
   case AI_LEVEL_EXPERIMENTAL:
+#endif /* DEBUG */
     return 100;
   case AI_LEVEL_COUNT:
     fc_assert(level != AI_LEVEL_COUNT);
@@ -191,7 +199,9 @@
   case AI_LEVEL_NORMAL:
   case AI_LEVEL_HARD:
   case AI_LEVEL_CHEATING:
+#ifdef DEBUG
   case AI_LEVEL_EXPERIMENTAL:
+#endif /* DEBUG */
     return 100;
   case AI_LEVEL_COUNT:
     fc_assert(level != AI_LEVEL_COUNT);

Modified: trunk/common/fc_types.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/fc_types.h?rev=27304&r1=27303&r2=27304&view=diff
==============================================================================
--- trunk/common/fc_types.h     (original)
+++ trunk/common/fc_types.h     Sun Dec 14 20:30:03 2014
@@ -238,8 +238,12 @@
 #define SPECENUM_VALUE5NAME N_("Hard")
 #define SPECENUM_VALUE6 AI_LEVEL_CHEATING
 #define SPECENUM_VALUE6NAME N_("Cheating")
+
+#ifdef DEBUG
 #define SPECENUM_VALUE7 AI_LEVEL_EXPERIMENTAL
 #define SPECENUM_VALUE7NAME N_("Experimental")
+#endif /* DEBUG */
+
 #define SPECENUM_COUNT AI_LEVEL_COUNT
 #include "specenum_gen.h"
 

Modified: trunk/server/commands.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/commands.c?rev=27304&r1=27303&r2=27304&view=diff
==============================================================================
--- trunk/server/commands.c     (original)
+++ trunk/server/commands.c     Sun Dec 14 20:30:03 2014
@@ -403,6 +403,7 @@
       "argument, sets the skill level for that player only."), NULL,
    CMD_ECHO_ALL, VCF_NONE, 50
   },
+#ifdef DEBUG
   {"experimental",     ALLOW_CTRL,
    /* TRANS: translate text between <> only */
    N_("experimental\n"
@@ -415,6 +416,7 @@
       "has no effect."), NULL,
    CMD_ECHO_ALL, VCF_NONE, 50
   },
+#endif /* DEBUG */
   {"cmdlevel", ALLOW_ADMIN,
    /* TRANS: translate text between <> only */
    N_("cmdlevel\n"

Modified: trunk/server/commands.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/commands.h?rev=27304&r1=27303&r2=27304&view=diff
==============================================================================
--- trunk/server/commands.h     (original)
+++ trunk/server/commands.h     Sun Dec 14 20:30:03 2014
@@ -67,7 +67,9 @@
   CMD_NORMAL,
   CMD_HARD,
   CMD_CHEATING,
+#ifdef DEBUG
   CMD_EXPERIMENTAL,
+#endif
   CMD_CMDLEVEL,
   CMD_FIRSTLEVEL,
   CMD_TIMEOUT,

Modified: trunk/server/savecompat.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/savecompat.c?rev=27304&r1=27303&r2=27304&view=diff
==============================================================================
--- trunk/server/savecompat.c   (original)
+++ trunk/server/savecompat.c   Sun Dec 14 20:30:03 2014
@@ -966,7 +966,11 @@
   case 8:
     return AI_LEVEL_CHEATING;
   case 10:
+#ifdef DEBUG
     return AI_LEVEL_EXPERIMENTAL;
+#else  /* DEBUG */
+    return AI_LEVEL_HARD;
+#endif /* DEBUG */
   }
 
   return ai_level_invalid();

Modified: trunk/server/stdinhand.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/stdinhand.c?rev=27304&r1=27303&r2=27304&view=diff
==============================================================================
--- trunk/server/stdinhand.c    (original)
+++ trunk/server/stdinhand.c    Sun Dec 14 20:30:03 2014
@@ -1858,7 +1858,9 @@
     case AI_LEVEL_NORMAL       : return CMD_NORMAL;
     case AI_LEVEL_HARD         : return CMD_HARD;
     case AI_LEVEL_CHEATING     : return CMD_CHEATING;
+#ifdef DEBUG
     case AI_LEVEL_EXPERIMENTAL : return CMD_EXPERIMENTAL;
+#endif /* DEBUG */
     case AI_LEVEL_COUNT        : return CMD_NORMAL;
   }
   log_error("Unknown AI level variant: %d.", level);
@@ -4238,7 +4240,9 @@
   case CMD_NORMAL:
   case CMD_HARD:
   case CMD_CHEATING:
+#ifdef DEBUG
   case CMD_EXPERIMENTAL:
+#endif
     return set_ai_level_named(caller, arg, command_name_by_number(cmd), check);
   case CMD_QUIT:
     return quit_game(caller, check);
@@ -6830,7 +6834,9 @@
   CMD_NORMAL,
   CMD_HARD,
   CMD_CHEATING,
+#ifdef DEBUG
   CMD_EXPERIMENTAL,
+#endif
   CMD_REMOVE,
   CMD_TEAM,
   CMD_PLAYERCOLOR,


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to