Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2002:
[Freeciv-Dev] Re: remove nearest_real_pos uses (PR#1211)
Home

[Freeciv-Dev] Re: remove nearest_real_pos uses (PR#1211)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Cc: bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: remove nearest_real_pos uses (PR#1211)
From: jdorje@xxxxxxxxxxxxxxxxxxxxx
Date: Mon, 7 Jan 2002 02:40:48 -0800 (PST)

jdorje@xxxxxxxxxxxxxxxxxxxxx wrote:

The attached patch removes two unnecessary (incorrect AFAICT) uses of nearest_real_pos.

Here's the patch.

jason




Index: server/maphand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/maphand.c,v
retrieving revision 1.91
diff -u -r1.91 maphand.c
--- server/maphand.c    2001/11/23 17:27:09     1.91
+++ server/maphand.c    2002/01/07 10:19:44
@@ -953,10 +953,6 @@
 struct player_tile *map_get_player_tile(int x, int y,
                                        struct player *pplayer)
 {
-  if (!is_real_tile(x, y)) {
-    freelog(LOG_ERROR, "Trying to get nonexistant tile at %i,%i", x, y);
-  }
-  nearest_real_pos(&x, &y);
   return pplayer->private_map + map_inx(x, y);
 }
  
Index: server/settlers.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/settlers.c,v
retrieving revision 1.115
diff -u -r1.115 settlers.c
--- server/settlers.c   2001/12/06 11:59:07     1.115
+++ server/settlers.c   2002/01/07 10:19:45
@@ -789,7 +789,7 @@
 **************************************************************************/
 int auto_settler_do_goto(struct player *pplayer, struct unit *punit, int x, 
int y)
 {
-  nearest_real_pos(&x, &y);
+  CHECK_MAP_POS(x, y);
   punit->goto_dest_x = x;
   punit->goto_dest_y = y;
   set_unit_activity(punit, ACTIVITY_GOTO);

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