[Freeciv-Dev] (PR#13369) Remove found_new_future_tech()
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: |
[Freeciv-Dev] (PR#13369) Remove found_new_future_tech() |
From: |
"Mateusz Stefek" <mstefek@xxxxxxxxx> |
Date: |
Wed, 29 Jun 2005 02:12:55 -0700 |
Reply-to: |
bugs@xxxxxxxxxxx |
<URL: http://bugs.freeciv.org/Ticket/Display.html?id=13369 >
This patch removes found_new_future_tech(). found_new_tech() can handle
A_FUTURE so we don't need such redundancy and found_new_tech() was
probably bug as well.
The patch makes pick_random_tech() static.
--
mateusz
? civgame-1000.sav.gz
? civgame-1500.sav.gz
? civgame-2000.sav.gz
? civgame-2500.sav.gz
? civgame-3000.sav.gz
? civgame-3500.sav.gz
Index: diplomats.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/diplomats.c,v
retrieving revision 1.81
diff -u -r1.81 diplomats.c
--- diplomats.c 27 Jun 2005 14:30:19 -0000 1.81
+++ diplomats.c 29 Jun 2005 09:08:38 -0000
@@ -666,7 +666,7 @@
/* Steal a future-tech. */
/* Do it. */
- found_new_future_tech(pplayer);
+ found_new_tech(pplayer, A_FUTURE, FALSE, TRUE, A_NONE);
/* Report it. */
notify_player_ex(pplayer, pcity->tile, E_MY_DIPLOMAT_THEFT,
Index: techtools.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/techtools.c,v
retrieving revision 1.11
diff -u -r1.11 techtools.c
--- techtools.c 29 Jun 2005 08:53:17 -0000 1.11
+++ techtools.c 29 Jun 2005 09:08:38 -0000
@@ -41,6 +41,8 @@
#include "techtools.h"
#include "unittools.h"
+static Tech_type_id pick_random_tech(struct player* plr);
+
/**************************************************************************
...
**************************************************************************/
@@ -448,16 +450,6 @@
}
/****************************************************************************
- Player has a new future technology (from somewhere). Logging &
- notification is not done here as it depends on how the tech came.
-****************************************************************************/
-void found_new_future_tech(struct player *pplayer)
-{
- get_player_research(pplayer)->future_tech++;
- get_player_research(pplayer)->techs_researched++;
-}
-
-/****************************************************************************
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.
@@ -488,7 +480,7 @@
Returns random researchable tech or A_FUTURE.
No side effects
****************************************************************************/
-Tech_type_id pick_random_tech(struct player* plr)
+static Tech_type_id pick_random_tech(struct player* plr)
{
int chosen, researchable = 0;
@@ -654,7 +646,7 @@
/* we've moved on to future tech */
if (get_player_research(target)->future_tech
> get_player_research(pplayer)->future_tech) {
- found_new_future_tech(pplayer);
+ found_new_tech(pplayer, A_FUTURE, FALSE, TRUE, A_NONE);
stolen_tech
= game.control.num_tech_types
+ get_player_research(pplayer)->future_tech;
Index: techtools.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/techtools.h,v
retrieving revision 1.3
diff -u -r1.3 techtools.h
--- techtools.h 28 Jun 2005 17:32:53 -0000 1.3
+++ techtools.h 29 Jun 2005 09:08:38 -0000
@@ -24,12 +24,10 @@
void found_new_tech(struct player *plr, Tech_type_id tech_found,
bool was_discovery, bool saving_bulbs,
Tech_type_id next_tech);
-void found_new_future_tech(struct player *pplayer);
void update_tech(struct player *plr, int bulbs);
void init_tech(struct player *plr, int tech_count);
-Tech_type_id pick_random_tech(struct player* plr);
-void choose_random_tech(struct player *plr);
void choose_tech(struct player *plr, Tech_type_id tech);
+void choose_random_tech(struct player* plr);
void choose_tech_goal(struct player *plr, Tech_type_id tech);
void get_a_tech(struct player *pplayer, struct player *target);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Freeciv-Dev] (PR#13369) Remove found_new_future_tech(),
Mateusz Stefek <=
|
|