Fix lradar to reject land units loaded on land units
authorMarkus Armbruster <armbru@pond.sub.org>
Wed, 13 Jul 2011 20:47:05 +0000 (22:47 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 16 Jul 2011 09:48:35 +0000 (11:48 +0200)
Probably overlooked when trains were added in 4.0.0.

While there, improve the message for land units on ships.

src/lib/commands/rada.c

index d21bbebb12e4cc91ba02d71e7fe60a9c9f8559c8..809b7f8c2dedf33fd61b626efe9a3ca398560294 100644 (file)
@@ -102,7 +102,13 @@ radar(int type)
                    continue;
                }
                if (item.land.lnd_ship >= 0) {
-                   pr("Units on ships can't use radar!\n");
+                   pr("%s is stowed on ship #%d, and can't use radar!\n",
+                      prland(&item.land), item.land.lnd_ship);
+                   continue;
+               }
+               if (item.land.lnd_land >= 0) {
+                   pr("%s is stowed on land #%d, and can't use radar!\n",
+                      prland(&item.land), item.land.lnd_land);
                    continue;
                }
                spy = lchr[item.land.lnd_type].l_spy;