From 011fa326d72ee8e36ca380340e0f9ef5ab56422e Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sat, 19 Nov 2005 15:15:49 +0000 Subject: [PATCH] (buil): When an argument is bad, do not offer to list types, just 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 | 33 ++++++++++++--------------------- 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/src/lib/commands/buil.c b/src/lib/commands/buil.c index 1e0e40a0..91a6afa0 100644 --- a/src/lib/commands/buil.c +++ b/src/lib/commands/buil.c @@ -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: