]> git.pond.sub.org Git - empserver/commitdiff
(buil): When an argument is bad, do not offer to list types, just
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 19 Nov 2005 15:15:49 +0000 (15:15 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 19 Nov 2005 15:15:49 +0000 (15:15 +0000)
print how to list them.

(buil): When an argument is bad, do not loop prompting, just
fail.  That's what the vast majority of commands do.

src/lib/commands/buil.c

index 1e0e40a071ca21dd6e98a4a8f963a660bed4f1b9..91a6afa027e158146b0cf6cf42a68a025fce1473 100644 (file)
@@ -104,7 +104,6 @@ buil(void)
            pr("Bad sector specification.\n");
            return RET_SYN;
        }
-      ask_again:
        tlev = (int)natp->nat_level[NAT_TLEV];
        rlev = (int)natp->nat_level[NAT_RLEV];
 
@@ -121,11 +120,9 @@ buil(void)
                    type = -1;
            }
            if (type < 0) {
-               pr("Illegal plane type: \"%s\"\n", p);
-               if (confirm("List plane types? "))
-                   show_plane_build(tlev);
-               player->argp[3] = 0;
-               goto ask_again;
+               pr("You can't build that!\n");
+               pr("Use `show plane build %d' to show types you can build.\n", tlev);
+               return RET_FAIL;
            }
            break;
        case 's':
@@ -142,11 +139,9 @@ buil(void)
                    type = -1;
            }
            if (type < 0) {
-               pr("Illegal ship type: \"%s\"\n", p);
-               if (confirm("List ship types? "))
-                   show_ship_build(tlev);
-               player->argp[3] = 0;
-               goto ask_again;
+               pr("You can't build that!\n");
+               pr("Use `show ship build %d' to show types you can build.\n", tlev);
+               return RET_FAIL;
            }
            break;
        case 'l':
@@ -163,11 +158,9 @@ buil(void)
                    type = -1;
            }
            if (type < 0) {
-               pr("Illegal land unit type: \"%s\"\n", p);
-               if (confirm("List unit types? "))
-                   show_land_build(tlev);
-               player->argp[3] = 0;
-               goto ask_again;
+               pr("You can't build that!\n");
+               pr("Use `show land build %d' to show types you can build.\n", tlev);
+               return RET_FAIL;
            }
            break;
        case 'b':
@@ -205,14 +198,12 @@ buil(void)
            }
            if (type < 0) {
                int tt = tlev;
-               pr("Possible nuke types are:\n");
                if (opt_DRNUKE)
                    tt = (tlev < (rlev / drnuke_const) ? (int)tlev :
                          (int)(rlev / drnuke_const));
-
-               show_nuke_build(tt);
-               player->argp[3] = 0;
-               goto ask_again;
+               pr("You can't build that!\n");
+               pr("Use `show nuke build %d' to show types you can build.\n", tlev);
+               return RET_FAIL;
            }
            break;
        default: