Complete.Org: Mailing Lists: Archives: freeciv-dev: June 2005:
[Freeciv-Dev] (PR#13339) caravan revenue and teams
Home

[Freeciv-Dev] (PR#13339) caravan revenue and teams

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#13339) caravan revenue and teams
From: "Mateusz Stefek" <mstefek@xxxxxxxxx>
Date: Sun, 26 Jun 2005 04:27:01 -0700
Reply-to: bugs@xxxxxxxxxxx

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

When caravan revenue is added to the research only one player gets
updated player information - this patch fixes the problem
--
mateusz
Index: server/unithand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/unithand.c,v
retrieving revision 1.340
diff -u -r1.340 unithand.c
--- server/unithand.c   23 Jun 2005 21:58:24 -0000      1.340
+++ server/unithand.c   26 Jun 2005 07:29:10 -0000
@@ -1412,7 +1412,14 @@
     }
   }
   
-  send_player_info(pplayer, pplayer);
+  /* The research has changed, we have to update all
+   * players sharing it */
+  players_iterate(aplayer) {
+    if (!players_on_same_team(pplayer, aplayer)) {
+      continue;
+    }
+    send_player_info(aplayer, aplayer);
+  } players_iterate_end;
   conn_list_do_unbuffer(pplayer->connections);
   return TRUE;
 }
Index: server/techtools.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/techtools.c,v
retrieving revision 1.4
diff -u -r1.4 techtools.c
--- server/techtools.c  25 Jun 2005 08:24:04 -0000      1.4
+++ server/techtools.c  26 Jun 2005 07:29:13 -0000
@@ -455,8 +455,10 @@
 }
 
 /****************************************************************************
-  Called from each city to update the research; it adds the given number of
-  bulbs into the player's tech and (if necessary) completes the research.
+  Adds the given number of  bulbs into the player's tech and 
+  (if necessary) completes the research.
+  The caller is responsible for sending updated player information.
+  This is called from each city every turn and from caravan revenue
 ****************************************************************************/
 void update_tech(struct player *plr, int bulbs)
 {

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#13339) caravan revenue and teams, Mateusz Stefek <=