(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:
parent
e3443c78eb
commit
011f88fec8
5 changed files with 9 additions and 26 deletions
|
@ -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",
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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 "
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue