[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]
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
- [Freeciv-Dev] [PATCH] use enum values for ai_choice at aicity.c (PR#1313),
Markus Linnala <=
|
|