contact: Rename getcontact() to in_contact()
The next commit will create a contact file, and the macro to get a contact entry will be named getcontact(). Rename the existing getcontact() out of the way. Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
parent
e61c332295
commit
7cc34abaca
9 changed files with 12 additions and 11 deletions
|
@ -168,7 +168,7 @@ extern char *natstate(struct natstr *np);
|
||||||
extern int getrel(struct natstr *np, natid them);
|
extern int getrel(struct natstr *np, natid them);
|
||||||
extern int relations_with(natid, natid);
|
extern int relations_with(natid, natid);
|
||||||
extern int getrejects(natid them, struct natstr *np);
|
extern int getrejects(natid them, struct natstr *np);
|
||||||
extern int getcontact(struct natstr *np, natid them);
|
extern int in_contact(struct natstr *np, natid them);
|
||||||
extern void putrel(struct natstr *np, natid them, int relate);
|
extern void putrel(struct natstr *np, natid them, int relate);
|
||||||
extern void putreject(struct natstr *np, natid them, int how, int what);
|
extern void putreject(struct natstr *np, natid them, int how, int what);
|
||||||
extern void agecontact(struct natstr *np);
|
extern void agecontact(struct natstr *np);
|
||||||
|
|
|
@ -87,7 +87,7 @@ decl(void)
|
||||||
if (who == (natid)ni.cur)
|
if (who == (natid)ni.cur)
|
||||||
continue;
|
continue;
|
||||||
if (opt_HIDDEN) {
|
if (opt_HIDDEN) {
|
||||||
if (!player->god && !getcontact(natp, ni.cur)) {
|
if (!player->god && !in_contact(natp, ni.cur)) {
|
||||||
pr("You haven't contacted country #%d yet\n", ni.cur);
|
pr("You haven't contacted country #%d yet\n", ni.cur);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,8 +103,8 @@ news(void)
|
||||||
nws.nws_ntm = 1;
|
nws.nws_ntm = 1;
|
||||||
if (opt_HIDDEN) {
|
if (opt_HIDDEN) {
|
||||||
if (!player->god &&
|
if (!player->god &&
|
||||||
!(getcontact(getnatp(player->cnum), nws.nws_ano) &&
|
!(in_contact(getnatp(player->cnum), nws.nws_ano) &&
|
||||||
getcontact(getnatp(player->cnum), nws.nws_vno)))
|
in_contact(getnatp(player->cnum), nws.nws_vno)))
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
page_has_news[rpt[nws.nws_vrb].r_newspage] = 1;
|
page_has_news[rpt[nws.nws_vrb].r_newspage] = 1;
|
||||||
|
|
|
@ -69,9 +69,9 @@ rela(void)
|
||||||
if (np->nat_stat < STAT_SANCT)
|
if (np->nat_stat < STAT_SANCT)
|
||||||
continue;
|
continue;
|
||||||
if (opt_HIDDEN) {
|
if (opt_HIDDEN) {
|
||||||
if (!player->god && !getcontact(natp, cn))
|
if (!player->god && !in_contact(natp, cn))
|
||||||
continue;
|
continue;
|
||||||
if (!player->god && !getcontact(getnatp(player->cnum), cn))
|
if (!player->god && !in_contact(getnatp(player->cnum), cn))
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
pr("%3d) %-20.20s ", cn, cname(cn));
|
pr("%3d) %-20.20s ", cn, cname(cn));
|
||||||
|
|
|
@ -58,7 +58,7 @@ repo(void)
|
||||||
if (nat.nat_stat == STAT_UNUSED)
|
if (nat.nat_stat == STAT_UNUSED)
|
||||||
continue;
|
continue;
|
||||||
if (opt_HIDDEN) {
|
if (opt_HIDDEN) {
|
||||||
if (!player->god && !getcontact(natp, ni.cur))
|
if (!player->god && !in_contact(natp, ni.cur))
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!player->god && nat.nat_stat != STAT_ACTIVE)
|
if (!player->god && nat.nat_stat != STAT_ACTIVE)
|
||||||
|
|
|
@ -108,7 +108,7 @@ agecontact(struct natstr *np)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
getcontact(struct natstr *np, natid them)
|
in_contact(struct natstr *np, natid them)
|
||||||
{
|
{
|
||||||
return np->nat_contact[them];
|
return np->nat_contact[them];
|
||||||
}
|
}
|
||||||
|
|
|
@ -184,7 +184,7 @@ nstr_eval(struct valstr *val, natid cnum, void *ptr, enum nsc_type want)
|
||||||
break;
|
break;
|
||||||
natp = getnatp(cnum);
|
natp = getnatp(cnum);
|
||||||
if (natp->nat_stat != STAT_GOD
|
if (natp->nat_stat != STAT_GOD
|
||||||
&& !(getcontact(natp, idx) && getcontact(ptr, idx)))
|
&& !(in_contact(natp, idx) && in_contact(ptr, idx)))
|
||||||
val->val_as.lng = -1;
|
val->val_as.lng = -1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -95,7 +95,8 @@ natarg(char *arg, char *prompt)
|
||||||
if (!np)
|
if (!np)
|
||||||
return -1;
|
return -1;
|
||||||
if (opt_HIDDEN) {
|
if (opt_HIDDEN) {
|
||||||
if (!player->god && !getcontact(getnatp(player->cnum), np->nat_cnum)) {
|
if (!player->god
|
||||||
|
&& !in_contact(getnatp(player->cnum), np->nat_cnum)) {
|
||||||
if (np->nat_stat != STAT_GOD) {
|
if (np->nat_stat != STAT_GOD) {
|
||||||
pr("Country '%s' has not been contacted.\n", arg);
|
pr("Country '%s' has not been contacted.\n", arg);
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
@ -252,7 +252,7 @@ share_incr(double res[], double tech[])
|
||||||
if (other->nat_stat != STAT_ACTIVE)
|
if (other->nat_stat != STAT_ACTIVE)
|
||||||
continue;
|
continue;
|
||||||
if (opt_HIDDEN) {
|
if (opt_HIDDEN) {
|
||||||
if (!getcontact(np, j))
|
if (!in_contact(np, j))
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue