Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2004:
[Freeciv-Dev] (PR#7266) dimension of a north-south wrapping iso-map
Home

[Freeciv-Dev] (PR#7266) dimension of a north-south wrapping iso-map

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#7266) dimension of a north-south wrapping iso-map
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 19 Jan 2004 01:15:45 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=7266 >

To wrap north-south an iso-map must have even map.ysize.

This patch adds a check for that into srv_loop.

Perhaps there is a better place for this, but I'm not sure what it is. 
It must be done after /start but before mapgen runs.

If there were an init_topology() function (as Marcelo wants) this check 
would go there.  The only reason I didn't do that was that the client 
really shouldn't be running this check.

jason

Index: server/srv_main.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/srv_main.c,v
retrieving revision 1.150
diff -u -r1.150 srv_main.c
--- server/srv_main.c   2003/12/15 17:08:00     1.150
+++ server/srv_main.c   2004/01/19 09:13:04
@@ -1600,6 +1600,14 @@
   test_random1(200000);
 #endif
     
+  if (topo_has_flag(TF_ISO) && topo_has_flag(TF_WRAPY)
+      && (map.ysize % 2 == 1)) {
+    /* To wrap north-south an iso-map must have even Y dimension.  Since the
+     * X dimension is compressed this isn't an issue for east-west
+     * wrapping. */
+    map.ysize++;
+  }
+
   if (game.is_new_game) {
     generate_ai_players();
   }

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#7266) dimension of a north-south wrapping iso-map, Jason Short <=