Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2005:
[Freeciv-Dev] Re: (PR#13488) T_UNKNOWN errors in 2.0
Home

[Freeciv-Dev] Re: (PR#13488) T_UNKNOWN errors in 2.0

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] Re: (PR#13488) T_UNKNOWN errors in 2.0
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 18 Jul 2005 10:41:40 -0700
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=13488 >

Here's a patch that fixes some of the problems.  However I have an idea
for a more inclusive fix for 2.0.

-jason


? ChangeLog-2.0.0
? diff
? freeciv-2.0.3.tar.gz
Index: common/map.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/map.c,v
retrieving revision 1.199.2.3
diff -p -u -r1.199.2.3 map.c
--- common/map.c        18 Oct 2004 22:40:33 -0000      1.199.2.3
+++ common/map.c        18 Jul 2005 17:40:58 -0000
@@ -1116,6 +1116,10 @@ static int tile_move_cost_ptrs(struct un
 {
   bool cardinal_move;
 
+  if (t1->terrain == T_UNKNOWN || t2->terrain == T_UNKNOWN) {
+    return 10 * SINGLE_MOVE; /* Arbitrary */
+  }
+
   if (game.slow_invasions
       && punit 
       && is_ground_unit(punit) 
Index: common/terrain.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/terrain.h,v
retrieving revision 1.29.2.1
diff -p -u -r1.29.2.1 terrain.h
--- common/terrain.h    18 Mar 2005 19:19:04 -0000      1.29.2.1
+++ common/terrain.h    18 Jul 2005 17:40:58 -0000
@@ -101,7 +101,8 @@ struct tile_type *get_tile_type(Terrain_
 Terrain_type_id get_terrain_by_name(const char * name);
 const char *get_terrain_name(Terrain_type_id type);
 enum terrain_flag_id terrain_flag_from_str(const char *s);
-#define terrain_has_flag(terr, flag) BV_ISSET(tile_types[(terr)].flags, flag)
+#define terrain_has_flag(terr, flag)                                   \
+  ((terr) != T_UNKNOWN && BV_ISSET(tile_types[(terr)].flags, (flag)))
 Terrain_type_id get_flag_terrain(enum terrain_flag_id flag);
 void tile_types_free(void);
 

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