(fort): Refuse to fortify land units embarked on land units. Properly

report failure to fortify.
This commit is contained in:
Markus Armbruster 2004-01-29 13:36:25 +00:00
parent 4b321add52
commit daad9ed79c

View file

@ -79,6 +79,10 @@ fort(void)
pr("%s is on a ship and can't be fortified\n", prland(&land)); pr("%s is on a ship and can't be fortified\n", prland(&land));
continue; continue;
} }
if (land.lnd_land >= 0) {
pr("%s is on a land unit and can't be fortified\n", prland(&land));
continue;
}
hard_amt = fort_amt; hard_amt = fort_amt;
@ -90,10 +94,13 @@ fort(void)
continue; continue;
} }
if (lnd_fortify (&land, hard_amt) <= 0) {
pr("%s can't be fortified%s\n", prland(&land),
land.lnd_harden >= land_mob_max ? " any further" : "");
continue;
}
nunits++; nunits++;
lnd_fortify (&land, hard_amt);
pr("%s hardened to %d\n", prland(&land), land.lnd_harden); pr("%s hardened to %d\n", prland(&land), land.lnd_harden);
putland(land.lnd_uid, &land); putland(land.lnd_uid, &land);