Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2004:
[Freeciv-Dev] Re: civserver crashed: http://pubserver.freeciv.org/games/
Home

[Freeciv-Dev] Re: civserver crashed: http://pubserver.freeciv.org/games/

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: civserver crashed: http://pubserver.freeciv.org/games/275432
From: Jason Dorje Short <jdorje@xxxxxxxxxxxx>
Date: Thu, 18 Mar 2004 14:45:58 -0500

Per I. Mathisen wrote:

The offending line is
  /* If the unit is under (human) orders we shouldn't control it. */
  assert(!unit_has_orders(punit));

Perhaps we shold reconsider this assert and make it fail more softly?

Perhaps. But there shouldn't be many of these bugs. I thought I fixed the one you found; are you sure you have up-to-date CVS code? The line number of the calling code (unittools.c:1618) is incorrect.

The only place I can see that might have holes is in handle_unit_orders.

jason
Index: server/unithand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/unithand.c,v
retrieving revision 1.290
diff -u -r1.290 unithand.c
--- server/unithand.c   8 Mar 2004 03:00:22 -0000       1.290
+++ server/unithand.c   18 Mar 2004 19:47:58 -0000
@@ -1524,6 +1524,10 @@
     return;
   }
 
+  if ((unit_owner(punit)->ai.control || punit->ai.control)
+      && punit->ai.ai_role != AIUNIT_NONE) {
+    ai_unit_new_role(punit, AIUNIT_NONE, -1, -1);
+  }
   punit->has_orders = TRUE;
   punit->orders.length = packet->length;
   punit->orders.index = 0;

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