ltend: Fail more nicely when land unit isn't on tender

Land units not on the tender are silently ignored.  This may leave the
player guessing why the command did nothing.  Reporting them all would
be annoying; I just changed tend to report only explicitly named ones.
Make ltend behave the same.

This does add a related annoyance: ltend can complain "not on ship"
when tending explicitly selected land units from multiple ships.
Tolerable.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
Markus Armbruster 2017-09-12 10:04:25 +02:00
parent 15a43a780a
commit eb5ed8802a
3 changed files with 24 additions and 3 deletions

View file

@ -32,6 +32,7 @@
* Thomas Ruschak
* Ken Stevens, 1995
* Steve McClure, 1998
* Markus Armbruster, 2004-2017
*/
#include <config.h>
@ -99,9 +100,12 @@ ltend(void)
while (nxtitem(&targets, &target)) {
if (!player->owner)
continue;
if (target.lnd_ship != tender.shp_uid)
if (target.lnd_ship != tender.shp_uid) {
if (targets.sel == NS_LIST)
pr("%s is not on %s!\n",
prland(&target), prship(&tender));
continue;
}
ontarget = target.lnd_item[ip->i_uid];
if (ontarget == 0 && amt < 0) {
pr("No %s on %s\n", ip->i_name, prland(&target));