(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)
|
if (player->argp[1] == 0)
|
||||||
as = player->cnum;
|
as = player->cnum;
|
||||||
else {
|
else {
|
||||||
if ((n = natarg(player->argp[1], "Which country? ")) < 0) {
|
if ((n = natarg(player->argp[1], "Which country? ")) < 0)
|
||||||
pr("Bad country number\n");
|
|
||||||
return RET_SYN;
|
return RET_SYN;
|
||||||
}
|
|
||||||
as = (natid)n;
|
as = (natid)n;
|
||||||
}
|
}
|
||||||
if ((natp = getnatp(as)) == 0) {
|
natp = getnatp(as);
|
||||||
pr("Bad country number %d\n", player->cnum);
|
|
||||||
return RET_SYN;
|
|
||||||
}
|
|
||||||
pr("\t%s Acceptance Status Report\t", cname(as));
|
pr("\t%s Acceptance Status Report\t", cname(as));
|
||||||
prdate();
|
prdate();
|
||||||
pr("\n Acceptance status %5s theirs\n",
|
pr("\n Acceptance status %5s theirs\n",
|
||||||
|
|
|
@ -53,10 +53,7 @@ flash(void)
|
||||||
us = getnatp(player->cnum);
|
us = getnatp(player->cnum);
|
||||||
if ((tocn = natarg(player->argp[1], "to which country? ")) < 0)
|
if ((tocn = natarg(player->argp[1], "to which country? ")) < 0)
|
||||||
return RET_SYN;
|
return RET_SYN;
|
||||||
if (!(to = getnatp((natid)tocn))) {
|
to = getnatp(tocn);
|
||||||
pr("Bad country number\n");
|
|
||||||
return RET_SYN;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (us->nat_stat == STAT_GOD) {
|
if (us->nat_stat == STAT_GOD) {
|
||||||
/* We are gods, we can flash anyone */
|
/* We are gods, we can flash anyone */
|
||||||
|
|
|
@ -59,10 +59,8 @@ nati(void)
|
||||||
else
|
else
|
||||||
cnum = player->cnum;
|
cnum = player->cnum;
|
||||||
|
|
||||||
if ((natp = getnatp(cnum)) == 0) {
|
if ((natp = getnatp(cnum)) == 0)
|
||||||
pr("Bad country number %d\n", cnum);
|
|
||||||
return RET_SYN;
|
return RET_SYN;
|
||||||
}
|
|
||||||
|
|
||||||
if (!player->god && cnum != player->cnum) {
|
if (!player->god && cnum != player->cnum) {
|
||||||
pr("Only deities can request a nation "
|
pr("Only deities can request a nation "
|
||||||
|
|
|
@ -72,12 +72,10 @@ new(void)
|
||||||
natp = getnatp(player->cnum);
|
natp = getnatp(player->cnum);
|
||||||
if (natp->nat_xorg != 0 || natp->nat_yorg != 0) {
|
if (natp->nat_xorg != 0 || natp->nat_yorg != 0) {
|
||||||
pr("Must be at 0,0 to add a new country\n");
|
pr("Must be at 0,0 to add a new country\n");
|
||||||
return 0;
|
return RET_FAIL;
|
||||||
}
|
|
||||||
if ((n = natarg(player->argp[1], "Country? ")) < 0) {
|
|
||||||
pr("Bad country number\n");
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
if ((n = natarg(player->argp[1], "Country? ")) < 0)
|
||||||
|
return RET_SYN;
|
||||||
num = n;
|
num = n;
|
||||||
natp = getnatp(num);
|
natp = getnatp(num);
|
||||||
if (natp->nat_stat != STAT_NEW) {
|
if (natp->nat_stat != STAT_NEW) {
|
||||||
|
|
|
@ -58,16 +58,11 @@ rela(void)
|
||||||
if (player->argp[1] == 0)
|
if (player->argp[1] == 0)
|
||||||
as = player->cnum;
|
as = player->cnum;
|
||||||
else {
|
else {
|
||||||
if ((n = natarg(player->argp[1], "Which country? ")) < 0) {
|
if ((n = natarg(player->argp[1], "Which country? ")) < 0)
|
||||||
pr("Bad country number\n");
|
|
||||||
return RET_SYN;
|
return RET_SYN;
|
||||||
}
|
|
||||||
as = (natid)n;
|
as = (natid)n;
|
||||||
}
|
}
|
||||||
if ((natp = getnatp(as)) == 0) {
|
natp = getnatp(as);
|
||||||
pr("Bad country number %d\n", player->cnum);
|
|
||||||
return RET_SYN;
|
|
||||||
}
|
|
||||||
pr("\t%s Diplomatic Relations Report\t", cname(as));
|
pr("\t%s Diplomatic Relations Report\t", cname(as));
|
||||||
prdate();
|
prdate();
|
||||||
pr("\n Formal Relations %5s theirs\n",
|
pr("\n Formal Relations %5s theirs\n",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue