Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2004:
[Freeciv-Dev] (PR#11327) pubserver crash in do_unit_goto
Home

[Freeciv-Dev] (PR#11327) pubserver crash in do_unit_goto

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#11327) pubserver crash in do_unit_goto
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 3 Dec 2004 18:16:33 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=11327 >

Crap.  Sending a goto packet for a unit with orders still causes a crash.

Side note: I don't really know where these goto packets come from.  In
this case a goto packet is sent for a settler unit that has orders.  I
don't think this is possible with an unmodified client.

-jason

Index: server/unithand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/unithand.c,v
retrieving revision 1.308.2.6
diff -u -r1.308.2.6 unithand.c
--- server/unithand.c   1 Dec 2004 23:43:03 -0000       1.308.2.6
+++ server/unithand.c   4 Dec 2004 02:14:20 -0000
@@ -79,10 +79,10 @@
     return;
   }
 
-  punit->goto_tile = ptile;
+  free_unit_orders(punit); /* This may reset punit->goto_tile also. */
 
+  punit->goto_tile = ptile;
   set_unit_activity(punit, ACTIVITY_GOTO);
-  free_unit_orders(punit);
 
   send_unit_info(NULL, punit);
 

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