<URL: http://bugs.freeciv.org/Ticket/Display.html?id=39635 >

 There are many legitimate reasons why fstk is called with unit type
it cannot handle (with custom rulesets at least). In these cases it
simply fails to find target, which is handled in a sane way.
 There is real problem in that AI is not using its units effectively
(fstk cannot handle all units), but rewriting that will not happen in
S2_1 (things have already improved in trunk). So there is no point in
flooding console with error messages (magic ruleset causes a lot of
these) in stable branch.

 Attached patch turns LOG_ERROR into LOG_DEBUG. For S2_1 only.

 - ML

diff -Nurd -X.diff_ignore freeciv/ai/aiunit.c freeciv/ai/aiunit.c
--- freeciv/ai/aiunit.c	2007-07-04 14:04:26.000000000 +0300
+++ freeciv/ai/aiunit.c	2007-08-30 16:15:53.000000000 +0300
@@ -1240,7 +1240,13 @@
   if (!is_ground_unit(punit) && !is_sailing_unit(punit)) {
     /* Don't know what to do with them! */
-    UNIT_LOG(LOG_ERROR, punit, "bad unit type passed to fstk");
+    /* This is not LOG_ERROR in stable branch, as calling
+     * fstk is in many cases right thing to do when custom
+     * rulesets are used - and callers correctly handle cases
+     * where fstk failed to find target.
+     * In trunk, handling of units different to those in default
+     * ruleset should be improved. */
+    UNIT_LOG(LOG_DEBUG, punit, "bad unit type passed to fstk");
     return 0;
Freeciv-dev mailing list

Reply via email to