From ae6ad76516fd04dae22510afbb5e3ee36aba3b12 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Tue, 26 Jan 2010 21:23:10 +0100 Subject: [PATCH] Clean up dead code in orde() Does not change optimized code (gcc -O) apart from __LINE__. --- src/lib/commands/orde.c | 36 ++++++++++++------------------------ 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/src/lib/commands/orde.c b/src/lib/commands/orde.c index 9f7fb96a..591069fc 100644 --- a/src/lib/commands/orde.c +++ b/src/lib/commands/orde.c @@ -59,7 +59,6 @@ int orde(void) { - int diffeachship = 0; int sub, level; int scuttling = 0; struct nstr_item nb; @@ -80,8 +79,7 @@ orde(void) continue; if (opt_SAIL) { if (*ship.shp_path) { - if (!diffeachship) - pr("Ship #%d has a \"sail\" path!\n", ship.shp_uid); + pr("Ship #%d has a \"sail\" path!\n", ship.shp_uid); continue; } } @@ -90,14 +88,8 @@ orde(void) "Ship #%d, declare, cancel, suspend, resume, level? ", ship.shp_uid); p = getstarg(player->argp[2], prompt, buf); - if (player->aborted || !p) + if (player->aborted || !p || !*p) return RET_FAIL; - if (!*p) { - if (!diffeachship) - return RET_FAIL; - else - continue; - } switch (*p) { default: pr("Bad order type!\n"); @@ -206,13 +198,11 @@ orde(void) i1 = whatitem(player->argp[5], "Commodity? "); if (!i1) break; - else { - p1 = getstarg(player->argp[6], "Amount? ", - buf); - if (!p1) - return RET_SYN; - level = atoi(p1); - } + p1 = getstarg(player->argp[6], "Amount? ", + buf); + if (!p1) + return RET_SYN; + level = atoi(p1); if (level < 0) { level = 0; /* prevent negatives. */ pr("You must use positive number! Level set to 0.\n"); @@ -226,13 +216,11 @@ orde(void) i1 = whatitem(player->argp[5], "Commodity? "); if (!i1) break; - else { - p1 = getstarg(player->argp[6], "Amount? ", - buf); - if (!p1) - return RET_SYN; - level = atoi(p1); - } + p1 = getstarg(player->argp[6], "Amount? ", + buf); + if (!p1) + return RET_SYN; + level = atoi(p1); if (level < 0) { level = 0; pr("You must use positive number! Level set to 0.\n");