Fail announce, pray, telegram and turn on aborted telegrams

Change tele() and turn() to return RET_FAIL when getele() fails.
Before, tele() returned RET_OK then, and turn() returned RET_SYN.
This commit is contained in:
Markus Armbruster 2008-08-09 11:52:04 -04:00
parent a532c76428
commit 358de131f7
2 changed files with 5 additions and 6 deletions

View file

@ -50,7 +50,7 @@ tele(void)
if (*player->argp[0] == 'a') { if (*player->argp[0] == 'a') {
if (getele("everybody", buf) <= 0) { if (getele("everybody", buf) <= 0) {
pr("Announcement aborted\n"); pr("Announcement aborted\n");
return RET_OK; return RET_FAIL;
} }
pr("\n"); pr("\n");
to = 0; to = 0;
@ -59,7 +59,7 @@ tele(void)
} else if (*player->argp[0] == 'p') { } else if (*player->argp[0] == 'p') {
if (getele("your Gracious Deity", buf) <= 0) { if (getele("your Gracious Deity", buf) <= 0) {
pr("Prayer aborted\n"); pr("Prayer aborted\n");
return RET_OK; return RET_FAIL;
} }
pr("\n"); pr("\n");
if (typed_wu(player->cnum, 0, buf, TEL_NORM) < 0) if (typed_wu(player->cnum, 0, buf, TEL_NORM) < 0)
@ -77,12 +77,12 @@ tele(void)
if (player->argp[2]) { if (player->argp[2]) {
if (getele("multiple recipients", buf) < 0) { if (getele("multiple recipients", buf) < 0) {
pr("Telegram aborted\n"); pr("Telegram aborted\n");
return RET_OK; return RET_FAIL;
} }
} else { } else {
if (getele(cname(to), buf) < 0) { if (getele(cname(to), buf) < 0) {
pr("Telegram aborted\n"); pr("Telegram aborted\n");
return RET_OK; return RET_FAIL;
} }
} }
pr("\n"); pr("\n");

View file

@ -76,12 +76,11 @@ turn(void)
time(&tgm.tel_date); time(&tgm.tel_date);
tgm.tel_length = getele("The World", msgbuf); tgm.tel_length = getele("The World", msgbuf);
if (tgm.tel_length < 0) { if (tgm.tel_length < 0) {
pr("Ignored\n"); pr("Ignored\n");
if (msgfilepath == downfil) if (msgfilepath == downfil)
pr("NOT disabling logins.\n"); pr("NOT disabling logins.\n");
return RET_SYN; return RET_FAIL;
} else if (tgm.tel_length == 0) { } else if (tgm.tel_length == 0) {
if (msgfilepath == motdfil) { if (msgfilepath == motdfil) {
pr("Removing exsting motd.\n"); pr("Removing exsting motd.\n");