Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2002:
[Freeciv-Dev] [PATCH] use enum values for ai_choice at aicity.c (PR#1313
Home

[Freeciv-Dev] [PATCH] use enum values for ai_choice at aicity.c (PR#1313

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Cc: bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] [PATCH] use enum values for ai_choice at aicity.c (PR#1313)
From: Markus Linnala <maage@xxxxxxxxx>
Date: Sun, 10 Mar 2002 08:21:04 -0800 (PST)

Use enum values instead of plain ints.

diff -ur -X freeciv/diff_ignore freeciv/ai/aicity.c freeciv-ct-none/ai/aicity.c
--- freeciv/ai/aicity.c Fri Mar  8 19:06:18 2002
+++ freeciv-ct-none/ai/aicity.c Sun Mar 10 18:17:37 2002
@@ -424,14 +424,14 @@
       buycost = city_buy_cost(pcity);
       if (pcity->shield_stock == 0) {
        /* nothing */
-      } else if (bestchoice.type == 0 && is_wonder(bestchoice.choice) &&
+      } else if (bestchoice.type == CT_NONE && is_wonder(bestchoice.choice) &&
                buycost >= 200) {
        /* wait for more vans */
-      } else if (bestchoice.type != 0 && unit_type_flag(bestchoice.choice, 
F_CITIES) &&
+      } else if (bestchoice.type != CT_NONE && 
unit_type_flag(bestchoice.choice, F_CITIES) &&
           !city_got_effect(pcity, B_GRANARY) && (pcity->size < 2 ||
          pcity->food_stock < city_granary_size(pcity->size-1))) {
        /* nothing */
-      } else if (bestchoice.type != 0 && bestchoice.type < 3 && /* not a 
defender */
+      } else if (bestchoice.type != CT_NONE && bestchoice.type != CT_DEFENDER 
&&
         buycost > unit_types[bestchoice.choice].build_cost * 2) { /* too 
expensive */
         if (unit_type_flag(bestchoice.choice, F_CARAVAN) &&
             pplayer->ai.maxbuycost < 100) pplayer->ai.maxbuycost = 100;

-- 
//Markus



[Prev in Thread] Current Thread [Next in Thread]