Complete.Org: Mailing Lists: Archives: freeciv-dev: June 2005:
[Freeciv-Dev] (PR#13326) Check player_research and player_tech_goal pack
Home

[Freeciv-Dev] (PR#13326) Check player_research and player_tech_goal pack

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#13326) Check player_research and player_tech_goal packets
From: "Mateusz Stefek" <mstefek@xxxxxxxxx>
Date: Fri, 24 Jun 2005 03:36:27 -0700
Reply-to: bugs@xxxxxxxxxxx

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

And this is S2_0 version
--
mateusz
Index: server/plrhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/plrhand.c,v
retrieving revision 1.330.2.23
diff -u -r1.330.2.23 plrhand.c
--- server/plrhand.c    10 Jun 2005 02:45:23 -0000      1.330.2.23
+++ server/plrhand.c    24 Jun 2005 10:35:04 -0000
@@ -817,6 +817,14 @@
 **************************************************************************/
 void handle_player_research(struct player *pplayer, int tech)
 {
+  if (tech != A_FUTURE && !tech_exists(tech)) {
+    return;
+  }
+  
+  if (tech != A_FUTURE && get_invention(pplayer, tech) != TECH_REACHABLE) {
+    return;
+  }
+
   /* choose_tech and send update for all players on the team. */
   players_iterate(aplayer) {
     if (pplayer == aplayer
@@ -833,6 +841,14 @@
 **************************************************************************/
 void handle_player_tech_goal(struct player *pplayer, int tech)
 {
+  if (tech != A_FUTURE && !tech_exists(tech)) {
+    return;
+  }
+  
+  if (tech != A_FUTURE && !tech_is_available(pplayer, tech)) {
+    return;
+  }
+
   choose_tech_goal(pplayer, tech);
   send_player_info(pplayer, pplayer);
 

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