Complete.Org: Mailing Lists: Archives: freeciv-dev: June 2005:
[Freeciv-Dev] (PR#13270) init_available_nations
Home

[Freeciv-Dev] (PR#13270) init_available_nations

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#13270) init_available_nations
From: "Mateusz Stefek" <mstefek@xxxxxxxxx>
Date: Sat, 25 Jun 2005 10:21:25 -0700
Reply-to: bugs@xxxxxxxxxxx

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

And this patch sends nation availability information with rulesets.
This fixes problems on european scenario
--
mateusz
Index: server/ruleset.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/ruleset.c,v
retrieving revision 1.267
diff -u -r1.267 ruleset.c
--- server/ruleset.c    11 Jun 2005 18:13:00 -0000      1.267
+++ server/ruleset.c    25 Jun 2005 17:19:45 -0000
@@ -103,6 +103,7 @@
 static void send_ruleset_terrain(struct conn_list *dest);
 static void send_ruleset_governments(struct conn_list *dest);
 static void send_ruleset_nations(struct conn_list *dest);
+static void send_ruleset_nations_availability(struct conn_list *dest);
 static void send_ruleset_cities(struct conn_list *dest);
 static void send_ruleset_game(struct conn_list *dest);
 
@@ -2921,6 +2922,22 @@
 }
 
 /**************************************************************************
+  Send nations availability information
+**************************************************************************/
+static void send_ruleset_nations_availability(struct conn_list *dest)
+{
+  int i;
+  for (i = 0; i < game.control.nation_count; i++) {
+    struct nation_type *nation = get_nation_by_idx(i);
+    struct packet_nation_available packet;
+    packet.id = i;
+    packet.is_unavailable = nation->is_unavailable;
+    packet.is_used = nation->is_used;
+    lsend_packet_nation_available(dest, &packet);
+  }
+}
+
+/**************************************************************************
   Send the city-style ruleset information (each style) to the specified
   connections.
 **************************************************************************/
@@ -3068,6 +3085,7 @@
   send_ruleset_terrain(dest);
   send_ruleset_buildings(dest);
   send_ruleset_nations(dest);
+  send_ruleset_nations_availability(dest);
   send_ruleset_cities(dest);
   send_ruleset_cache(dest);
 

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