Re: [Freeciv-Dev] Freeciv 1.7.2 released!
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
I wrote:
> With impeccable timing, I've just found a bug in the combat
> calculations. :-7
Might at well make a patch I guess...
-- David
diff -u -r --exclude-from exclude freeciv-cvs/server/unithand.c
freeciv-mod/server/unithand.c
--- freeciv-cvs/server/unithand.c Thu Dec 10 20:45:16 1998
+++ freeciv-mod/server/unithand.c Sun Dec 27 12:29:49 1998
@@ -434,12 +434,7 @@
struct city *pcity;
struct city *incity, *nearcity1, *nearcity2;
incity = map_get_city(pdefender->x, pdefender->y);
- punit->moves_left-=3;
-
- if(punit->moves_left<0)
- punit->moves_left=0;
-
if(unit_flag(punit->type, F_NUCLEAR)) {
struct packet_nuke_tile packet;
@@ -464,6 +459,13 @@
}
unit_versus_unit(punit, pdefender);
+
+ /* Adjust attackers moves_left _after_ unit_versus_unit() so that
+ * the movement attack modifier is correct! --dwp
+ */
+ punit->moves_left-=3;
+ if(punit->moves_left<0)
+ punit->moves_left=0;
if (punit->hp && (pcity=map_get_city(pdefender->x, pdefender->y)) &&
pcity->size>1 && !city_got_citywalls(pcity) && is_ground_unit(punit)) {
pcity->size--;
|
|