(fort): Refuse to fortify land units embarked on land units. Properly
report failure to fortify.
This commit is contained in:
parent
4b321add52
commit
daad9ed79c
1 changed files with 10 additions and 3 deletions
|
@ -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);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue