Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2003:
[Freeciv-Dev] Patch to fix client-side crash with new pathfinding code
Home

[Freeciv-Dev] Patch to fix client-side crash with new pathfinding code

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxxx
Cc: rt@xxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Patch to fix client-side crash with new pathfinding code
From: sam+civ@xxxxxxxxxxxxxxxxxxxx
Date: Wed, 28 May 2003 00:15:07 -0700 (PDT)

First of all, I really like the new pathfinding code.  I think it makes
for some far nicer paths than the older code.

That said, I was able to find a reproducable crash with the new
code.  I have come up with a patch which addresses this issue; however
I do not know the pathfinding code well enough to assertain whether
this is the optimal resolution to the crash I saw.

This patch is for the May 21 CVS snapshot, the most recent currently
available snapshot.

If people wish more data, I have a saved game and a recipe to
reproduce this crash.

- Sam

P.S.  Thank you for comitting my novice level patch; this will, hopefully,
      resolve the issues Freeciv newbies have with the game being too
      hard for them.
This patch fixes a crash which the pathfinding code has.

--- freeciv/client/goto.c.orig  Thu May 15 21:58:03 2003
+++ freeciv/client/goto.c       Tue May 27 23:34:41 2003
@@ -257,7 +257,10 @@
   assert(goto_map.num_parts >= 1);
 
   reset_last_part();
-  pf_destroy_path(p->path);
+  /* We do not always have a path */
+  if(p->path != NULL) {
+      pf_destroy_path(p->path);
+      }
   pf_destroy_map(p->map);
   goto_map.num_parts--;
 }

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] Patch to fix client-side crash with new pathfinding code, sam+civ <=