Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2003:
[Freeciv-Dev] Re: (PR#4639) units get more MP than max MP
Home

[Freeciv-Dev] Re: (PR#4639) units get more MP than max MP

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#4639) units get more MP than max MP
From: "ue80@xxxxxxxxxxxxxxxxxxxxx" <ue80@xxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 21 Jul 2003 10:53:12 -0700
Reply-to: rt@xxxxxxxxxxxxxx

On Mon, Jul 21, 2003 at 10:36:02AM -0700, Jason Short wrote:
> 
> 
> > A possible solution could be like the attached patch ... problem that
> > "to_unit" isn't a "struct unit" ...
> 
> Patch?

Sorry ..

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

Index: server/unittools.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/unittools.c,v
retrieving revision 1.234
diff -u -r1.234 unittools.c
--- server/unittools.c  2003/07/18 20:19:38     1.234
+++ server/unittools.c  2003/07/21 17:01:50
@@ -1432,8 +1432,8 @@
    * and don't kill the unit. */
   punit->hp = MAX(punit->hp * get_unit_type(to_unit)->hp
                  / unit_type(punit)->hp, 1);
-  punit->moves_left = (punit->moves_left * get_unit_type(to_unit)->move_rate
-                      / unit_type(punit)->move_rate);
+  punit->moves_left = punit->moves_left * unit_move_rate(to_unit)
+                  / unit_move_rate(punit);
 
   conn_list_do_buffer(&pplayer->connections);
   punit->type = to_unit;

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