From: Markus Armbruster Date: Sun, 23 Jan 2011 18:39:48 +0000 (+0100) Subject: Fix land unit attack mobility cost out of allied sectors X-Git-Tag: v4.3.27~161 X-Git-Url: http://git.pond.sub.org/?p=empserver;a=commitdiff_plain;h=98c5a92baaffe27267ad894cfeb6d1660746e635 Fix land unit attack mobility cost out of allied sectors Land units pay a mobility penalty when marching into a non-old-owned sector without sector mobility, to slow them down in newly taken sectors. Attacking land units pay this penalty regardless of sector mobility. When attacking out of an allied sector, the penalty was computed as if the land unit was owned by that ally. Attacking sectors old-owned by that ally was too cheap, and taking back one's own was too expensive. Broken since attacking land units pay the "newly taken" mobility penalty: commit 2e693275, v4.3.6. --- diff --git a/src/lib/subs/attsub.c b/src/lib/subs/attsub.c index 4c2f7ed22..cbb457c73 100644 --- a/src/lib/subs/attsub.c +++ b/src/lib/subs/attsub.c @@ -1022,7 +1022,7 @@ ask_olist(int combat_mode, struct combat *off, struct combat *def, * of high-mobility sectors (mountains): for those we * still require attack mobility. */ - pathcost = att_mobcost(off->own, def, lnd_mobtype(&land)); + pathcost = att_mobcost(land.lnd_own, def, lnd_mobtype(&land)); mobcost = lnd_pathcost(&land, pathcost); if (pathcost < 1.0) { if (land.lnd_mobil <= 0) { @@ -2515,7 +2515,7 @@ take_move_in_mob(int combat_mode, struct ulist *llp, struct combat *off, switch (combat_mode) { case A_ATTACK: mobcost = lnd_pathcost(&llp->unit.land, - att_mobcost(off->own, def, + att_mobcost(llp->unit.land.lnd_own, def, lnd_mobtype(&llp->unit.land))); break; case A_ASSAULT: