]> git.pond.sub.org Git - empserver/commitdiff
Fail announce, pray, telegram and turn on aborted telegrams
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 9 Aug 2008 15:52:04 +0000 (11:52 -0400)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 9 Aug 2008 16:10:06 +0000 (12:10 -0400)
Change tele() and turn() to return RET_FAIL when getele() fails.
Before, tele() returned RET_OK then, and turn() returned RET_SYN.

src/lib/commands/tele.c
src/lib/commands/turn.c

index 4a257c359945846a00f6fc75869209e1792d9d0b..522097eb7920afd63f1499c2c0fc8b4d59e891fa 100644 (file)
@@ -50,7 +50,7 @@ tele(void)
     if (*player->argp[0] == 'a') {
        if (getele("everybody", buf) <= 0) {
            pr("Announcement aborted\n");
-           return RET_OK;
+           return RET_FAIL;
        }
        pr("\n");
        to = 0;
@@ -59,7 +59,7 @@ tele(void)
     } else if (*player->argp[0] == 'p') {
        if (getele("your Gracious Deity", buf) <= 0) {
            pr("Prayer aborted\n");
-           return RET_OK;
+           return RET_FAIL;
        }
        pr("\n");
        if (typed_wu(player->cnum, 0, buf, TEL_NORM) < 0)
@@ -77,12 +77,12 @@ tele(void)
                if (player->argp[2]) {
                    if (getele("multiple recipients", buf) < 0) {
                        pr("Telegram aborted\n");
-                       return RET_OK;
+                       return RET_FAIL;
                    }
                } else {
                    if (getele(cname(to), buf) < 0) {
                        pr("Telegram aborted\n");
-                       return RET_OK;
+                       return RET_FAIL;
                    }
                }
                pr("\n");
index 7818791356325da20e619121322e0aa9b3598fa3..006700046b38cbeeec5290e0a2b7aa64c0ae7ca8 100644 (file)
@@ -76,12 +76,11 @@ turn(void)
 
     time(&tgm.tel_date);
     tgm.tel_length = getele("The World", msgbuf);
-
     if (tgm.tel_length < 0) {
        pr("Ignored\n");
        if (msgfilepath == downfil)
            pr("NOT disabling logins.\n");
-       return RET_SYN;
+       return RET_FAIL;
     } else if (tgm.tel_length == 0) {
        if (msgfilepath == motdfil) {
            pr("Removing exsting motd.\n");