Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2003:
[Freeciv-Dev] Re: (PR#4267) Update unitproduction when new tech is resea
Home

[Freeciv-Dev] Re: (PR#4267) Update unitproduction when new tech is resea

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] Re: (PR#4267) Update unitproduction when new tech is researched
From: "ue80@xxxxxxxxxxxxxxxxxxxxx" <ue80@xxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 20 May 2003 10:20:24 -0700
Reply-to: rt@xxxxxxxxxxxxxx

On Mon, May 19, 2003 at 06:25:16AM -0700, ue80@xxxxxxxxxxxxxxxxxxxxx wrote:
> 
> Hi,
> 
> the production from warriors isn't updated when gunpowder is researched,
> but when feudalism is researched the production will be changed. 
> 
> The check for update production should not only look 1 step.

Ok, i've looked in the code ... the server only has updated when it was
possible to build "unit_types[id].obsoleted_by". That check was wrong.

What i don't like is that in unittype.c is can_upgrade_unittype which is
nearly the same as unit_upgrades_to from cityturn.c, why 2 functions?

Thomas
-- 
Thomas Strub  ***  eMail ue80@xxxxxxxxxxxxxxxxxxxxx
jb: people are stupid, they don't want to learn.

Index: server/cityturn.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/cityturn.c,v
retrieving revision 1.212
diff -u -r1.212 cityturn.c
--- server/cityturn.c   2003/05/13 07:04:28     1.212
+++ server/cityturn.c   2003/05/20 17:13:12
@@ -867,7 +867,7 @@
 {
   struct player *pplayer = city_owner(pcity);
   int id = pcity->currently_building;
-  int id2 = unit_upgrades_to(pcity, unit_types[id].obsoleted_by);
+  int id2 = unit_upgrades_to(pcity, pcity->currently_building);
 
   if (can_build_unit_direct(pcity, id2)) {
     pcity->currently_building=id2;

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