]> git.pond.sub.org Git - empserver/commitdiff
bomb: Don't list bombable commodities on invalid selection
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 29 May 2016 09:58:32 +0000 (11:58 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 6 Aug 2017 17:59:56 +0000 (19:59 +0200)
comm_bomb() first lists commodities that can be bombed and are
present, then prompts for the one to bomb.  If the player selects a
bomb-proof one, it rejects it, lists the bombable ones, and prompts
again.  This can only happen when option SUPER_BARS is enabled, and
the player selects bars.  Looks like this:

    Bomb what? (ship, plane, land unit, efficiency, commodities) c
    some civilians
    some military
    commodity to bomb? b
    You can't bomb bars of gold!
    Bombable: civilians, military, shells, guns, petrol, iron ore, dust (gold), food, oil, light products, heavy products, uncompensated workers, radioactive materials
    commodity to bomb?

The list is of marginal value.  It was more useful back when
comm_bomb() didn't list commodities before prompting (BSD Empire 1.1).
It's also illegible.  Drop it.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
src/lib/commands/bomb.c

index a1dc368591a2f1a54c40749a31b0d6c4cbe6a807..1de00905f3f24352c07dd8e16ab81c02eb396606 100644 (file)
@@ -329,16 +329,9 @@ comm_bomb(struct emp_qelem *list, struct sctstr *target)
            if (&ichr[bombcomm[i]] == ip)
                break;
        }
-       if (i == nbomb) {
+       if (i == nbomb)
            pr("You can't bomb %s!\n", ip->i_name);
-           for (i = 0; i < nbomb; i++) {
-               if (opt_SUPER_BARS && bombcomm[i] == I_BAR)
-                   continue;
-               pr("%s%s", i == 0 ? "Bombable: " : ", ",
-                  ichr[bombcomm[i]].i_name);
-           }
-           pr("\n");
-       } else
+       else
            break;
     }
     for (qp = list->q_forw; qp != list; qp = next) {