Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2003:
[Freeciv-Dev] (PR#6127) [Bug] Units can have more MPs than their move ra
Home

[Freeciv-Dev] (PR#6127) [Bug] Units can have more MPs than their move ra

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#6127) [Bug] Units can have more MPs than their move rate.
From: "Gregory Berkolaiko" <Gregory.Berkolaiko@xxxxxxxxxxxx>
Date: Wed, 10 Sep 2003 08:14:21 -0700
Reply-to: rt@xxxxxxxxxxxxxx

This happens rather often due to wonderous effects.
Examples:

1. A player gets a ship by bribe, inheritance, incitement or diplomacy 
(the last two -- with a city) from a player with Magellan.

2. A player loses his Magellan city to another player

The former can be fixed by the attached patch.  The latter is very hard to 
fix.

G.


Index: server/unittools.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/unittools.c,v
retrieving revision 1.248
diff -u -r1.248 unittools.c
--- server/unittools.c  2003/09/09 20:10:28     1.248
+++ server/unittools.c  2003/09/10 15:06:51
@@ -1487,7 +1487,7 @@
 
   if (moves_left >= 0) {
     /* Override default full MP */
-    punit->moves_left = moves_left;
+    punit->moves_left = MIN(moves_left, unit_move_rate(punit));
   }
 
   /* Assume that if moves_left < 0 then the unit is "fresh",

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