]> git.pond.sub.org Git - empserver/commitdiff
Clean up dead code in orde()
authorMarkus Armbruster <armbru@pond.sub.org>
Tue, 26 Jan 2010 20:23:10 +0000 (21:23 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Tue, 26 Jan 2010 20:38:31 +0000 (21:38 +0100)
Does not change optimized code (gcc -O) apart from __LINE__.

src/lib/commands/orde.c

index 9f7fb96afa60d5f602f3c4e921221f05d08b679c..591069fc353f3d02766fa9cceb52784f0b5eff8e 100644 (file)
@@ -59,7 +59,6 @@
 int
 orde(void)
 {
 int
 orde(void)
 {
-    int diffeachship = 0;
     int sub, level;
     int scuttling = 0;
     struct nstr_item nb;
     int sub, level;
     int scuttling = 0;
     struct nstr_item nb;
@@ -80,8 +79,7 @@ orde(void)
            continue;
        if (opt_SAIL) {
            if (*ship.shp_path) {
            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;
            }
        }
                continue;
            }
        }
@@ -90,14 +88,8 @@ orde(void)
                "Ship #%d, declare, cancel, suspend, resume, level? ",
                ship.shp_uid);
        p = getstarg(player->argp[2], prompt, buf);
                "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;
            return RET_FAIL;
-       if (!*p) {
-           if (!diffeachship)
-               return RET_FAIL;
-           else
-               continue;
-       }
        switch (*p) {
        default:
            pr("Bad order type!\n");
        switch (*p) {
        default:
            pr("Bad order type!\n");
@@ -206,13 +198,11 @@ orde(void)
                    i1 = whatitem(player->argp[5], "Commodity? ");
                    if (!i1)
                        break;
                    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");
                    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;
                    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");
                    if (level < 0) {
                        level = 0;
                        pr("You must use positive number! Level set to 0.\n");