Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2003:
[Freeciv-Dev] (PR#6285) rand_map_pos using native coordinates
Home

[Freeciv-Dev] (PR#6285) rand_map_pos using native coordinates

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#6285) rand_map_pos using native coordinates
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 25 Sep 2003 13:12:51 -0700
Reply-to: rt@xxxxxxxxxxxxxx

This simple patch rewrites rand_map_pos to use native coordinates.  This 
allows it to work with iso-maps.

jason

Index: common/map.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/map.c,v
retrieving revision 1.145
diff -u -r1.145 map.c
--- common/map.c        2003/09/25 20:55:01     1.145
+++ common/map.c        2003/09/25 21:02:58
@@ -1489,10 +1489,8 @@
 **************************************************************************/
 void rand_map_pos(int *x, int *y)
 {
-  do {
-    *x = myrand(map.xsize);
-    *y = myrand(map.ysize);
-  } while (!is_normal_map_pos(*x, *y));
+  native_to_map_pos(x, y, myrand(map.xsize), myrand(map.ysize));
+  CHECK_MAP_POS(*x, *y);
 }
 
 /**************************************************************************

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