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

> [jdorje - Fri Jul 28 06:52:22 2006]:
> Anyone have a patch for this?

Attached.

 - Per
Index: server/settlers.c
===================================================================
--- server/settlers.c	(revision 12614)
+++ server/settlers.c	(working copy)
@@ -85,6 +85,12 @@
   /* Free city reservations */
   ai_unit_new_role(punit, AIUNIT_NONE, NULL);
 
+  pcity = tile_get_city(ptile);
+  if (pcity) {
+    freelog(LOG_ERROR, "%s: There is already a city at (%d, %d)!", 
+            pplayer->name, TILE_XY(ptile));
+    return FALSE;
+  }
   handle_unit_build_city(pplayer, punit->id,
 			 city_name_suggestion(pplayer, ptile));
   pcity = tile_get_city(ptile);
@@ -988,6 +994,7 @@
           UNIT_LOG(LOG_ERROR, punit, "could not make city on %s",
                    tile_get_info_text(punit->tile));
           ai_unit_new_role(punit, AIUNIT_NONE, NULL);
+          return; /* Avoid infinite recursion at all costs! */
         } else {
           return; /* We came, we saw, we built... */
         }
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to