Fail commands properly when they get aborted

The old code didn't return RET_SYN when aborting at the following
prompts:

* designate second argument

* morale second argument

* route second argument

* set third argument

* tend fourth argument

* zdone last argument
This commit is contained in:
Markus Armbruster 2008-07-19 10:00:23 -04:00
parent a7cf69af50
commit be41e70fa8
6 changed files with 14 additions and 12 deletions

View file

@ -60,7 +60,7 @@ desi(void)
natp = getnatp(player->cnum);
cap_x = natp->nat_xcap;
cap_y = natp->nat_ycap;
while (!player->aborted && nxtsct(&nstr, &sect)) {
while (nxtsct(&nstr, &sect)) {
if (!player->owner)
continue;
if (!player->god && dchr[sect.sct_type].d_cost < 0)
@ -68,8 +68,10 @@ desi(void)
sprintf(prompt, "%s %d%% %s desig? ",
xyas(sect.sct_x, sect.sct_y, player->cnum),
sect.sct_effic, dchr[sect.sct_type].d_name);
if ((p = getstarg(player->argp[2], prompt, buf)) == 0)
continue;
if ((p = getstarg(player->argp[2], prompt, buf)) == 0) {
rc = RET_SYN;
break;
}
if (!check_sect_ok(&sect))
continue;