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.
This commit is contained in:
Markus Armbruster 2011-01-23 19:39:48 +01:00
parent 13d9057bd8
commit 98c5a92baa

View file

@ -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: