Complete.Org: Mailing Lists: Archives: freeciv-ai: October 2002:
[freeciv-ai] do not assert transport without destination
Home

[freeciv-ai] do not assert transport without destination

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv ai <freeciv-ai@xxxxxxxxxxx>
Subject: [freeciv-ai] do not assert transport without destination
From: Jordi Negrevernis i Font <jorneg@xxxxxxxxxxx>
Date: Sat, 12 Oct 2002 20:55:22 +0200


   The same as subject.

--- aiunit.c.orig       Sat Oct 12 20:20:23 2002
+++ aiunit.c    Sat Oct 12 17:43:36 2002
@@ -2222,9 +2222,14 @@
   if (p != 0) {
     freelog(LOG_DEBUG, "%s#%d@(%d,%d), p=%d, n=%d",
                  unit_name(punit->type), punit->id, punit->x, punit->y, p, n);
-    if (punit->moves_left > 0 && n != 0)
+    if (punit->moves_left > 0 && n != 0) {
+      /* something bad has happened, we don't have destination */
+      if (punit->goto_dest_x == -1 && punit->goto_dest_y == -1) {
+        ai_unit_ready(punit);
+        return;
+      }
       do_unit_goto(punit, GOTO_MOVE_ANY, FALSE);
-    else if (n == 0 && !map_get_city(punit->x, punit->y)) { /* rest in a city, 
for unhap */
+    } else if (n == 0 && !map_get_city(punit->x, punit->y)) { /* rest in a 
city, for unhap */
       x = punit->goto_dest_x; y = punit->goto_dest_y;
       if (find_nearest_friendly_port(punit)
          && do_unit_goto(punit, GOTO_MOVE_ANY, FALSE) == GR_DIED) {
--- aihand.c.orig       Sat Oct 12 20:19:20 2002
+++ aihand.c    Sat Oct 12 19:39:24 2002
@@ -225,6 +225,11 @@
     pplayer->economic.tax = 10 * n;
   }
 
+  /* do not allow a Despotism to have a 100% Tax rate */
+  if ( !mystrcasecmp(g->name_orig, "Despotism") ) {
+    if ( pplayer->economic.tax >= 80 ) pplayer->economic.tax = 80;
+  }
+
 /* once we have tech_want established, can compare it to cash want here -- 
Syela */
   pplayer->economic.science = 100 - pplayer->economic.tax - 
pplayer->economic.luxury;
   while (pplayer->economic.science > maxrate * 10) {
--- aiunit.c.orig       Sat Oct 12 20:20:23 2002
+++ aiunit.c    Sat Oct 12 17:43:36 2002
@@ -2222,9 +2222,14 @@
   if (p != 0) {
     freelog(LOG_DEBUG, "%s#%d@(%d,%d), p=%d, n=%d",
                  unit_name(punit->type), punit->id, punit->x, punit->y, p, n);
-    if (punit->moves_left > 0 && n != 0)
+    if (punit->moves_left > 0 && n != 0) {
+      /* something bad has happened, we don't have destination */
+      if (punit->goto_dest_x == -1 && punit->goto_dest_y == -1) {
+        ai_unit_ready(punit);
+        return;
+      }
       do_unit_goto(punit, GOTO_MOVE_ANY, FALSE);
-    else if (n == 0 && !map_get_city(punit->x, punit->y)) { /* rest in a city, 
for unhap */
+    } else if (n == 0 && !map_get_city(punit->x, punit->y)) { /* rest in a 
city, for unhap */
       x = punit->goto_dest_x; y = punit->goto_dest_y;
       if (find_nearest_friendly_port(punit)
          && do_unit_goto(punit, GOTO_MOVE_ANY, FALSE) == GR_DIED) {

[Prev in Thread] Current Thread [Next in Thread]