Author: cazfi
Date: Tue Jan  6 10:09:10 2015
New Revision: 27545

URL: http://svn.gna.org/viewcvs/freeciv?rev=27545&view=rev
Log:
Store information whether calculation was prematurely aborted or not to the cm 
result
for debugging purposes.

See patch #5649

Modified:
    trunk/common/aicore/cm.c
    trunk/common/aicore/cm.h

Modified: trunk/common/aicore/cm.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/aicore/cm.c?rev=27545&r1=27544&r2=27545&view=diff
==============================================================================
--- trunk/common/aicore/cm.c    (original)
+++ trunk/common/aicore/cm.c    Tue Jan  6 10:09:10 2015
@@ -1930,6 +1930,8 @@
     max_count = CM_MAX_LOOP;
   }
 
+  result->aborted = FALSE;
+
   /* search until we find a feasible solution */
   while (!bb_next(state)) {
     /* Limit the number of loops. */
@@ -1938,6 +1940,7 @@
     if (loop_count > max_count) {
       log_error("Did not find a cm solution in %d iterations for %s.",
                 max_count, city_name(state->pcity));
+      result->aborted = TRUE;
       break;
     }
   }

Modified: trunk/common/aicore/cm.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/aicore/cm.h?rev=27545&r1=27544&r2=27545&view=diff
==============================================================================
--- trunk/common/aicore/cm.h    (original)
+++ trunk/common/aicore/cm.h    Tue Jan  6 10:09:10 2015
@@ -45,6 +45,7 @@
 
 /* A result which can examined. */
 struct cm_result {
+  bool aborted;
   bool found_a_valid, disorder, happy;
 
   int surplus[O_LAST];


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

Reply via email to