[freeciv-ai] (PR#12226) bug in adjust_building_want_by_effect?
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://bugs.freeciv.org/Ticket/Display.html?id=12226 >
I don't entirely understand this code either. Seems it was written by
Vasco. But I'm pretty sure this patch fixes at least one bug.
The code is supposed to check if all the requirements for the effect,
except for the building we're contemplating, are active. Without the
continue we set is_useful to FALSE any time the building we're
contemplating isn't present - which is always.
-jason
Index: ai/aicity.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/aicity.c,v
retrieving revision 1.193
diff -u -r1.193 aicity.c
--- ai/aicity.c 3 Feb 2005 08:38:55 -0000 1.193
+++ ai/aicity.c 14 Feb 2005 18:13:54 -0000
@@ -281,6 +281,7 @@
if (preq->source.type == REQ_BUILDING
&& preq->source.value.building == id) {
mypreq = preq;
+ continue;
}
if (!is_req_active(TARGET_BUILDING, pplayer, pcity, id, NULL, preq)) {
useful = FALSE;
|
|