Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2000:
[Freeciv-Dev] server crash in latest cvs
Home

[Freeciv-Dev] server crash in latest cvs

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] server crash in latest cvs
From: John-Marc Chandonia <jmc@xxxxxxxxxxxxxxxx>
Date: Wed, 5 Jan 2000 19:53:27 -0800

Hi,
        There is a bug in the current server (Jan 5 CVS) such that when
an AI-controlled boat that is carrying another unit tries to attack an
enemy, the server will abort().  While this strategy might not always
be a good idea, crashing the server just makes the AI in question look
like a sore loser.

        The included saved game should crash in the first turn after starting,
when somebody's caravel (carrying a cannon) tries to attack another
caravel.  It is only 31k bzip'ed, so I'm just attaching to this post.

        This patch fixes the problem, allowing the attack to proceed.
I'm not sure why the warning comment from Syela is there; this seems
to indicate there used to be a bug where a boat thought it was carrying
a unit from a different position?  I need to test this patch further
to make sure it is doing what it's supposed to, but at least it doesn't
crash the server.

--- unithand.c.orig     Wed Jan  5 19:30:47 2000
+++ unithand.c  Wed Jan  5 19:35:43 2000
@@ -917,12 +917,10 @@
           passenger = unit_list_find(&(map_get_tile(punit->x, 
punit->y)->units),
               punit->ai.passenger);
           if (passenger) {
-            if (get_transporter_capacity(punit)) abort();
-            else {
+            if (!get_transporter_capacity(punit))
              freelog(LOG_NORMAL, "%s#%d@(%d,%d) thinks %s#%d is a passenger?",
                      unit_name(punit->type), punit->id, punit->x, punit->y,
                      unit_name(passenger->type), passenger->id);
-           }
           }
         }
         if (get_unit_type(punit->type)->attack_strength == 0) {


JMC
-- 
John-Marc Chandonia (jmc@xxxxxxxxxxxxxxxx)              We're everywhere...
Cohen Lab, University of California San Francisco       for your convenience.
http://yuri.harvard.edu/~jmc                                -- Psi Corps <*>

Attachment: civgame1140.sav.bz2
Description: Binary data


[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] server crash in latest cvs, John-Marc Chandonia <=