tend ltend: Reject foreign tenders and land units more nicely
We silently ignore foreign ships and land units. This may leave the player guessing why the command did nothing. Report explicitly named ones like this You don't own ship #160! except for tend's target ships. Nice reporting is a bit more involved there, because you can tend to foreign target ships as long as they're friendly. Left for later. Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
parent
eb5ed8802a
commit
1bde4df2bd
5 changed files with 30 additions and 7 deletions
|
@ -84,8 +84,11 @@ tend(void)
|
|||
return RET_SYN;
|
||||
|
||||
while (nxtitem(&tenders, &tender)) {
|
||||
if (!player->owner)
|
||||
if (!player->owner) {
|
||||
if (tenders.sel == NS_LIST)
|
||||
pr("You don't own ship #%d!\n", tender.shp_uid);
|
||||
continue;
|
||||
}
|
||||
if (type == EF_LAND) {
|
||||
sprintf(prompt, "Land unit(s) to tend from %s? ",
|
||||
prship(&tender));
|
||||
|
@ -214,8 +217,11 @@ tend_land(struct shpstr *tenderp, char *units)
|
|||
return RET_SYN;
|
||||
|
||||
while (nxtitem(&lni, &land)) {
|
||||
if (!player->owner)
|
||||
if (!player->owner) {
|
||||
if (lni.sel == NS_LIST)
|
||||
pr("You don't own land unit #%d!\n", land.lnd_uid);
|
||||
continue;
|
||||
}
|
||||
if (land.lnd_ship != tenderp->shp_uid) {
|
||||
if (lni.sel == NS_LIST)
|
||||
pr("%s is not on %s!\n", prland(&land), prship(tenderp));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue