extern char *natstate(struct natstr *np);
extern int getrel(struct natstr *np, natid them);
extern int relations_with(natid, natid);
-extern int nat_accepts(struct natstr *, natid, enum rej_comm);
+extern int nat_accepts(natid, natid, enum rej_comm);
extern int in_contact(natid, natid);
extern void putrel(struct natstr *np, natid them, int relate);
extern void agecontact(struct natstr *np);
#include "commands.h"
-static void pr_accept(struct natstr *, natid);
+static void pr_accept(natid, natid);
/*
* report rejection status
if (np->nat_stat == STAT_UNUSED)
continue;
pr("%3d) %-14.14s ", cn, cname(cn));
- pr_accept(natp, cn);
- pr_accept(np, as);
+ pr_accept(as, cn);
+ pr_accept(cn, as);
pr("\n");
}
return RET_OK;
}
static void
-pr_accept(struct natstr *to, natid from)
+pr_accept(natid to, natid from)
{
static char *yes_no[] = { "YES", " NO" };
pr("You can't loan yourself money!\n");
return RET_FAIL;
}
- natp = getnatp(recipient);
- if (!nat_accepts(natp, player->cnum, REJ_LOAN)) {
+ if (!nat_accepts(recipient, player->cnum, REJ_LOAN)) {
pr("%s is rejecting your loans.\n", cname(recipient));
return RET_SYN;
}
if (res <= 0)
break;
if (*kind == 'a') {
- if ((!nat_accepts(np, tgm.tel_from, REJ_ANNO))
+ if ((!nat_accepts(player->cnum, tgm.tel_from, REJ_ANNO))
|| tgm.tel_date < then) {
res = tel_read_body(telfp, mbox, &tgm, NULL, NULL);
if (res < 0)
kk++;
continue;
}
- if (!nat_accepts(natp, player->cnum, REJ_TELE)) {
+ if (!nat_accepts(to, player->cnum, REJ_TELE)) {
pr("%s is rejecting your telegrams.\n", cname(to));
return RET_SYN;
}
}
int
-nat_accepts(struct natstr *np, natid them, enum rej_comm what)
+nat_accepts(natid us, natid them, enum rej_comm what)
{
return getnatp(them)->nat_stat == STAT_GOD
- || !(getrejectp(np->nat_cnum)->rej_rejects[them] & bit(what));
+ || !(getrejectp(us)->rej_rejects[them] & bit(what));
}
void
setrel(natid us, natid them, int rel)
{
struct natstr *mynp = getnatp(us);
- struct natstr *themnp = getnatp(them);
int oldrel;
char *whichway;
int n_up = 0;
rel = AT_WAR;
if (CANT_HAPPEN(rel > ALLIED))
rel = ALLIED;
- if (CANT_HAPPEN(!mynp || !themnp))
+ if (CANT_HAPPEN(!mynp))
return;
if (us == them)
return;
pr("%s\n", addendum);
mpr(us, "Diplomatic relations with %s %s to \"%s\".\n",
cname(them), whichway, relates[rel]);
- if (nat_accepts(themnp, us, REJ_TELE))
+ if (nat_accepts(them, us, REJ_TELE))
mpr(them,
"Country %s has %s their relations with you to \"%s\"!\n",
prnat(mynp), whichway, relates[rel]);
for (to = 0; NULL != (np = getnatp(to)); to++) {
if (np->nat_stat < STAT_SANCT)
continue;
- if (!nat_accepts(np, from, REJ_ANNO))
+ if (!nat_accepts(to, from, REJ_ANNO))
continue;
if (!np->nat_ann || !tel.tel_cont) {
np->nat_ann++;