Author: sveinung
Date: Mon Mar 24 19:57:57 2014
New Revision: 24723

URL: http://svn.gna.org/viewcvs/freeciv?rev=24723&view=rev
Log:
AI: Effects from local range buildings could be active in 1 city

When assigning building want a local building requirement could be active in 1
city. It could also, if a local building isn't sent to the evaluation function,
be active in 0 cities.

The advantage of assuming the local range is 0 is that the AI isn't confused by
rule set bugs that result in requirements that are impossible to fulfill. A
local building requirement in a requirement list that is evaluated without a
local building would otherwise trick the AI into thinking it can get it by
building the required building.

The advantage of assuming that a local building requirement is valid in 1 city
is that it can reason about triggering effects like Upkeep_Free. It is also more
correct in general to assume a local building requirement affects 1 city. In my
view this makes up for the AI being confused by a buggy ruleset.

See bug #21852

Modified:
    branches/S2_4/ai/default/aicity.c

Modified: branches/S2_4/ai/default/aicity.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_4/ai/default/aicity.c?rev=24723&r1=24722&r2=24723&view=diff
==============================================================================
--- branches/S2_4/ai/default/aicity.c   (original)
+++ branches/S2_4/ai/default/aicity.c   Mon Mar 24 19:57:57 2014
@@ -1762,8 +1762,7 @@
 
   cities[REQ_RANGE_CONTINENT] = ai->stats.cities[tile_continent(pcity->tile)];
 
-  cities[REQ_RANGE_CITY] = 1;
-  cities[REQ_RANGE_LOCAL] = 0;
+  cities[REQ_RANGE_CITY] = cities[REQ_RANGE_LOCAL] = 1;
 
   effect_list_iterate(get_req_source_effects(&source), peffect) {
     struct requirement *mypreq = NULL;


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

Reply via email to