Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2003:
[Freeciv-Dev] (PR#3010) core dump from client air goto
Home

[Freeciv-Dev] (PR#3010) core dump from client air goto

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: per@xxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#3010) core dump from client air goto
From: "Jason Short via RT" <rt@xxxxxxxxxxxxxx>
Date: Sat, 8 Feb 2003 10:53:47 -0800
Reply-to: rt.freeciv.org@xxxxxxxxxxxxxx

[jdorje - Sat Feb  8 18:46:05 2003]:

> [glip - Fri Feb  7 20:53:56 2003]:

> > Why not set it right after init_warmap is called?

> The alternative is to put the code right after warmap is created in
> init_warmap.  But you must be sure you've caught all cases, and you must
> also still initialize it at the beginning of the function.

Patch attached.  Looks like things were simpler than I thought...

jason

Index: server/gotohand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/gotohand.c,v
retrieving revision 1.162
diff -u -r1.162 gotohand.c
--- server/gotohand.c   2003/02/04 23:12:31     1.162
+++ server/gotohand.c   2003/02/08 18:52:18
@@ -563,10 +563,9 @@
   struct unit *pcargo;
   /* 
    * Land/air units use warmap.cost while sea units use
-   * warmap.seacost.  Don't ask me why.  --JDS 
+   * warmap.seacost.  Some code will use both.
    */
-  unsigned char *warmap_cost =
-      (move_type == SEA_MOVING) ? warmap.seacost : warmap.cost;
+  unsigned char *warmap_cost;
 
   orig_x = punit->x;
   orig_y = punit->y;
@@ -578,6 +577,7 @@
   local_vector[orig_x][orig_y] = 0;
 
   init_warmap(punit->x, punit->y, move_type);
+  warmap_cost = (move_type == SEA_MOVING) ? warmap.seacost : warmap.cost;
   add_to_mapqueue(0, orig_x, orig_y);
 
   if (punit && unit_flag(punit, F_IGTER))

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