]> git.pond.sub.org Git - empserver/commitdiff
Don't let engineer mine while it is on a ship or land unit
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 14 Feb 2009 08:06:51 +0000 (09:06 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 15 Feb 2009 11:54:19 +0000 (12:54 +0100)
src/lib/commands/mine.c

index 6f9ed2581f168a32881051a3d19e566006d7f20d..75ea7c354bd6edd2c36e5d4a3abea4f7fd5cb971 100644 (file)
@@ -109,6 +109,11 @@ landmine(void)
        lp = &lchr[(int)land.lnd_type];
        if (!(lp->l_flags & L_ENGINEER))
            continue;
+       if (land.lnd_ship >= 0 || land.lnd_land >= 0) {
+           pr("%s is on a %s\n", prland(&land),
+              land. lnd_ship >= 0 ? "ship" : "land unit");
+           continue;
+       }
        if (land.lnd_mobil < 1) {
            pr("Unit %d is out of mobility\n", land.lnd_uid);
            continue;