Complete.Org: Mailing Lists: Archives: freeciv-dev: June 2005:
[Freeciv-Dev] (PR#13378) remove unused next_tech argument of found_new_t
Home

[Freeciv-Dev] (PR#13378) remove unused next_tech argument of found_new_t

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#13378) remove unused next_tech argument of found_new_tech()
From: "Mateusz Stefek" <mstefek@xxxxxxxxx>
Date: Thu, 30 Jun 2005 01:19:16 -0700
Reply-to: bugs@xxxxxxxxxxx

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

This patch removes unused next_tech argument of found_new_tech.
--
mateusz
? server/civgame-1000.sav.gz
? server/civgame-1500.sav.gz
? server/civgame-2000.sav.gz
? server/civgame-2500.sav.gz
? server/civgame-3000.sav.gz
? server/civgame-3500.sav.gz
Index: server/diplhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/diplhand.c,v
retrieving revision 1.95
diff -u -r1.95 diplhand.c
--- server/diplhand.c   23 Jun 2005 21:58:23 -0000      1.95
+++ server/diplhand.c   30 Jun 2005 08:17:36 -0000
@@ -369,7 +369,7 @@
         gamelog(GAMELOG_TREATY, GL_TECH, pgiver, pdest);
        do_dipl_cost(pdest);
 
-       found_new_tech(pdest, pclause->value, FALSE, TRUE, A_NONE);
+       found_new_tech(pdest, pclause->value, FALSE, TRUE);
        break;
       case CLAUSE_GOLD:
        notify_player(pdest, _("You get %d gold."), pclause->value);
Index: server/diplomats.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/diplomats.c,v
retrieving revision 1.82
diff -u -r1.82 diplomats.c
--- server/diplomats.c  30 Jun 2005 08:07:10 -0000      1.82
+++ server/diplomats.c  30 Jun 2005 08:17:39 -0000
@@ -666,7 +666,7 @@
     /* Steal a future-tech. */
 
     /* Do it. */
-    found_new_tech(pplayer, A_FUTURE, FALSE, TRUE, A_NONE);    
+    found_new_tech(pplayer, A_FUTURE, FALSE, TRUE);    
 
     /* Report it. */
     notify_player_ex(pplayer, pcity->tile, E_MY_DIPLOMAT_THEFT,
@@ -686,7 +686,7 @@
 
     /* Do it. */
     do_conquer_cost (pplayer);
-    found_new_tech (pplayer, target, FALSE, TRUE, A_NONE);
+    found_new_tech (pplayer, target, FALSE, TRUE);
     /* Report it. */
     notify_player_ex(pplayer, pcity->tile, E_MY_DIPLOMAT_THEFT,
                     _("Your %s stole %s from %s."),
Index: server/techtools.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/techtools.c,v
retrieving revision 1.12
diff -u -r1.12 techtools.c
--- server/techtools.c  30 Jun 2005 08:07:10 -0000      1.12
+++ server/techtools.c  30 Jun 2005 08:17:40 -0000
@@ -130,7 +130,7 @@
       MAX(research->bulbs_researched - total_bulbs_required(plr), 0);
 
   /* do all the updates needed after finding new tech */
-  found_new_tech(plr, research->researching, TRUE, TRUE, A_NONE);
+  found_new_tech(plr, research->researching, TRUE, TRUE);
 }
 
 /****************************************************************************
@@ -181,7 +181,7 @@
                           get_tech_name(pplayer, i), buf);
 
          do_free_cost(pplayer);
-         found_new_tech(pplayer, i, FALSE, TRUE, A_NONE);
+         found_new_tech(pplayer, i, FALSE, TRUE);
          break;
        }
       }
@@ -272,8 +272,7 @@
   is the next tech to research.
 ****************************************************************************/
 void found_new_tech(struct player *plr, Tech_type_id tech_found,
-                   bool was_discovery, bool saving_bulbs,
-                   Tech_type_id next_tech)
+                   bool was_discovery, bool saving_bulbs)
 {
   bool bonus_tech_hack = FALSE;
   bool was_first = FALSE;
@@ -349,7 +348,7 @@
     research->tech_goal = A_UNSET;
   }
 
-  if (tech_found == research->researching && next_tech == A_NONE) {
+  if (tech_found == research->researching) {
     /* try to pick new tech to research */
 
     if (choose_goal_tech(plr)) {
@@ -393,11 +392,8 @@
                         get_tech_name(plr, tech_found));
       }
     }
-  } else if (tech_found == research->researching && next_tech > A_NONE) {
-    /* Next target already determined. We always save bulbs. */
-    research->researching = next_tech;
   }
-
+  
   if (!saving_bulbs && research->bulbs_researched > 0) {
     research->bulbs_researched = 0;
   }
@@ -646,7 +642,7 @@
     /* we've moved on to future tech */
     if (get_player_research(target)->future_tech
         > get_player_research(pplayer)->future_tech) {
-      found_new_tech(pplayer, A_FUTURE, FALSE, TRUE, A_NONE);  
+      found_new_tech(pplayer, A_FUTURE, FALSE, TRUE);  
       stolen_tech
        = game.control.num_tech_types
          + get_player_research(pplayer)->future_tech;
@@ -694,7 +690,7 @@
                   get_nation_name_plural(target->nation));
 
   do_conquer_cost(pplayer);
-  found_new_tech(pplayer, stolen_tech, FALSE, TRUE, A_NONE);
+  found_new_tech(pplayer, stolen_tech, FALSE, TRUE);
 }
 
 /****************************************************************************
@@ -775,7 +771,7 @@
   
   tech = pick_random_tech(pplayer);
   do_free_cost(pplayer);
-  found_new_tech(pplayer, tech, FALSE, TRUE, A_NONE);
+  found_new_tech(pplayer, tech, FALSE, TRUE);
   return tech;
 }
 
@@ -790,6 +786,6 @@
   }
   tech = get_player_research(pplayer)->researching;
   do_free_cost(pplayer);
-  found_new_tech(pplayer, tech, FALSE, TRUE, A_NONE);
+  found_new_tech(pplayer, tech, FALSE, TRUE);
   return tech;
 }
Index: server/techtools.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/techtools.h,v
retrieving revision 1.4
diff -u -r1.4 techtools.h
--- server/techtools.h  30 Jun 2005 08:07:10 -0000      1.4
+++ server/techtools.h  30 Jun 2005 08:17:40 -0000
@@ -22,8 +22,7 @@
 
 void do_tech_parasite_effect(struct player *pplayer);
 void found_new_tech(struct player *plr, Tech_type_id tech_found,
-                   bool was_discovery, bool saving_bulbs,
-                   Tech_type_id next_tech);
+                   bool was_discovery, bool saving_bulbs);
 void update_tech(struct player *plr, int bulbs);
 void init_tech(struct player *plr, int tech_count);
 void choose_tech(struct player *plr, Tech_type_id tech);
Index: server/scripting/api_actions.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/scripting/api_actions.c,v
retrieving revision 1.3
diff -u -r1.3 api_actions.c
--- server/scripting/api_actions.c      23 Jun 2005 21:58:24 -0000      1.3
+++ server/scripting/api_actions.c      30 Jun 2005 08:17:40 -0000
@@ -71,7 +71,7 @@
 
   if (get_invention(pplayer, id) != TECH_KNOWN) {
     do_free_cost(pplayer);
-    found_new_tech(pplayer, id, FALSE, TRUE, A_NONE);
+    found_new_tech(pplayer, id, FALSE, TRUE);
     return TRUE;
   } else {
     return FALSE;

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