<URL: http://bugs.freeciv.org/Ticket/Display.html?id=33324 >
This patch replaces hardcoded city walls cost with call to
impr_buy_gold_cost(). Note that hardcoded value were no longer true
even for default ruleset.
- ML
diff -Nurd -X.diff_ignore freeciv/ai/advmilitary.c freeciv/ai/advmilitary.c
--- freeciv/ai/advmilitary.c 2006-07-17 14:28:36.000000000 +0300
+++ freeciv/ai/advmilitary.c 2007-01-12 01:54:15.000000000 +0200
@@ -1283,8 +1283,7 @@
"our_def=%d", urgency, danger, num_defenders, our_def);
/* FIXME: 1. Will tend to build walls beofre coastal irrespectfully what
- * type of danger we are facing
- * 2. (80 - pcity->shield_stock) * 2 below is hardcoded price of walls */
+ * type of danger we are facing */
/* We will build walls if we can and want and (have "enough" defenders or
* can just buy the walls straight away) */
@@ -1297,7 +1296,7 @@
&& can_build_improvement(pcity, wall_id)
&& (danger < 101 || num_defenders > 1
|| (pcity->ai.grave_danger == 0
- && pplayer->economic.gold > (80 - pcity->shield_stock) * 2))
+ && pplayer->economic.gold > impr_buy_gold_cost(wall_id, pcity->shield_stock)))
&& ai_fuzzy(pplayer, TRUE)) {
/* NB: great wall is under domestic */
choice->choice = wall_id;
_______________________________________________
Freeciv-dev mailing list
[email protected]
https://mail.gna.org/listinfo/freeciv-dev