(acce, flash, nati, new, rela): Don't bother to complain about bad

country argument, natarg() does that.

(acce, flash, nati, rela): natarg() ensures getnatp() succeeds, no
need to check.
This commit is contained in:
Markus Armbruster 2006-01-06 17:44:31 +00:00
parent e3443c78eb
commit 011f88fec8
5 changed files with 9 additions and 26 deletions

View file

@ -58,16 +58,11 @@ acce(void)
if (player->argp[1] == 0)
as = player->cnum;
else {
if ((n = natarg(player->argp[1], "Which country? ")) < 0) {
pr("Bad country number\n");
if ((n = natarg(player->argp[1], "Which country? ")) < 0)
return RET_SYN;
}
as = (natid)n;
}
if ((natp = getnatp(as)) == 0) {
pr("Bad country number %d\n", player->cnum);
return RET_SYN;
}
natp = getnatp(as);
pr("\t%s Acceptance Status Report\t", cname(as));
prdate();
pr("\n Acceptance status %5s theirs\n",

View file

@ -53,10 +53,7 @@ flash(void)
us = getnatp(player->cnum);
if ((tocn = natarg(player->argp[1], "to which country? ")) < 0)
return RET_SYN;
if (!(to = getnatp((natid)tocn))) {
pr("Bad country number\n");
return RET_SYN;
}
to = getnatp(tocn);
if (us->nat_stat == STAT_GOD) {
/* We are gods, we can flash anyone */

View file

@ -59,10 +59,8 @@ nati(void)
else
cnum = player->cnum;
if ((natp = getnatp(cnum)) == 0) {
pr("Bad country number %d\n", cnum);
if ((natp = getnatp(cnum)) == 0)
return RET_SYN;
}
if (!player->god && cnum != player->cnum) {
pr("Only deities can request a nation "

View file

@ -72,12 +72,10 @@ new(void)
natp = getnatp(player->cnum);
if (natp->nat_xorg != 0 || natp->nat_yorg != 0) {
pr("Must be at 0,0 to add a new country\n");
return 0;
}
if ((n = natarg(player->argp[1], "Country? ")) < 0) {
pr("Bad country number\n");
return 0;
return RET_FAIL;
}
if ((n = natarg(player->argp[1], "Country? ")) < 0)
return RET_SYN;
num = n;
natp = getnatp(num);
if (natp->nat_stat != STAT_NEW) {

View file

@ -58,16 +58,11 @@ rela(void)
if (player->argp[1] == 0)
as = player->cnum;
else {
if ((n = natarg(player->argp[1], "Which country? ")) < 0) {
pr("Bad country number\n");
if ((n = natarg(player->argp[1], "Which country? ")) < 0)
return RET_SYN;
}
as = (natid)n;
}
if ((natp = getnatp(as)) == 0) {
pr("Bad country number %d\n", player->cnum);
return RET_SYN;
}
natp = getnatp(as);
pr("\t%s Diplomatic Relations Report\t", cname(as));
prdate();
pr("\n Formal Relations %5s theirs\n",