Author: cazfi
Date: Thu Feb  4 19:11:56 2016
New Revision: 31749

URL: http://svn.gna.org/viewcvs/freeciv?rev=31749&view=rev
Log:
Improved caravan foreign trade setting logging

See patch #6895

Modified:
    branches/S2_6/common/aicore/caravan.c

Modified: branches/S2_6/common/aicore/caravan.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/common/aicore/caravan.c?rev=31749&r1=31748&r2=31749&view=diff
==============================================================================
--- branches/S2_6/common/aicore/caravan.c       (original)
+++ branches/S2_6/common/aicore/caravan.c       Thu Feb  4 19:11:56 2016
@@ -95,6 +95,23 @@
                                 enum log_level level, const char *file,
                                 const char *function, int line)
 {
+  const char *foreign = "<illegal>";
+
+  switch (parameter->allow_foreign_trade) {
+  case FTL_NATIONAL_ONLY:
+    foreign = "no";
+    break;
+  case FTL_ALLIED:
+    foreign = "allied";
+    break;
+  case FTL_PEACEFUL:
+    foreign = "peaceful";
+    break;
+  case FTL_NONWAR:
+    foreign = "anything but enemies";
+    break;
+  }
+
   do_log(file, function, line, FALSE, level,
          "parameter {\n"
          "  horizon   = %d\n"
@@ -111,7 +128,7 @@
          parameter->consider_trade ? "trade" : "-",
          parameter->consider_wonders ? "wonders" : "-",
          parameter->account_for_broken_routes ? "yes" : "no",
-         parameter->allow_foreign_trade != FTL_NATIONAL_ONLY ? "yes" : "no",
+         foreign,
          parameter->ignore_transit_time ? "yes" : "no",
          parameter->convert_trade ? "yes" : "no");
 }


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

Reply via email to