]> git.pond.sub.org Git - empserver/commitdiff
Fail ltend command properly when it gets aborted
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 27 Jul 2008 01:13:09 +0000 (21:13 -0400)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 27 Jul 2008 01:13:09 +0000 (21:13 -0400)
The old code didn't return RET_SYN when aborting at the prompts for
the third and fourth argument.

While there, return RET_SYN instead of RET_OK when the tender can't
hold the commodity to be tended.

src/lib/commands/lten.c

index f51469802017533bc7af7a1c0a58145aba101451..3aaba7129bd1178cdc60864f9216d2df651ebb08 100644 (file)
@@ -77,7 +77,7 @@ ltend(void)
            continue;
        if ((p =
             getstarg(player->argp[3], "Amount to transfer? ", buf)) == 0)
-           break;
+           return RET_SYN;
        if (!check_ship_ok(&tender))
            return RET_FAIL;
        if ((amt = atoi(p)) == 0)
@@ -92,12 +92,12 @@ ltend(void)
        if (maxtender == 0) {
            pr("A %s cannot hold any %s\n",
               mchr[(int)tender.shp_type].m_name, ip->i_name);
-           break;
+           return RET_FAIL;
        }
        if (!snxtitem(&targets, EF_LAND,
                      getstarg(player->argp[4], "Units to be tended? ",
                               buf)))
-           break;
+           return RET_SYN;
        if (!check_ship_ok(&tender))
            return RET_FAIL;
        total = 0;