Make selector terr do the right thing for deities
Commit db1ac2ed
(v4.3.6) introduced a separate territory for deities,
and made the territory command use it by default for deities. Deities
can still access the old default territory as territory number 0.
Selectors terr, terr0 (alias for terr), terr1, terr2, terr3 remained
unchanged, and a new selector dterr was created to let deities access
the deity territory.
Make selector terr virtual, so that it can do "the right thing", just
like the territory command: select territory 0 for mortals, and the
deity territory for deities.
Unfortunately, this requires us to switch xdump to use terr0 instead
of terr, because otherwise the deity xdump would contain the deity
territory twice, and territory 0 not at all.
This commit is contained in:
parent
7a06a58bec
commit
89d168cd65
2 changed files with 16 additions and 3 deletions
|
@ -42,11 +42,12 @@ designation/infrastructure
|
|||
.L effic
|
||||
.L mobil
|
||||
.L terr
|
||||
alias for terr0 (mortal player) or dterr (deity)
|
||||
.L terr0
|
||||
alias for terr
|
||||
.L terr1
|
||||
.L terr2
|
||||
.L terr3
|
||||
.L dterr
|
||||
.L timestamp
|
||||
.L fallout
|
||||
.L road
|
||||
|
|
|
@ -47,6 +47,7 @@
|
|||
|
||||
static void *nsc_ver(struct valstr *, struct natstr *, void *);
|
||||
static void *nsc_ver_maxnoc(struct valstr *, struct natstr *, void *);
|
||||
static void *nsc_sct_terr(struct valstr *, struct natstr *, void *);
|
||||
static void *nsc_pln_att(struct valstr *, struct natstr *, void *);
|
||||
static void *nsc_pln_def(struct valstr *, struct natstr *, void *);
|
||||
static void *nsc_lnd_att(struct valstr *, struct natstr *, void *);
|
||||
|
@ -133,8 +134,8 @@ struct castr sect_ca[] = {
|
|||
{"effic", fldoff(sct_effic), NSC_UCHAR, 0, NULL, EF_BAD, 0},
|
||||
{"mobil", fldoff(sct_mobil), NSC_SHORT, 0, NULL, EF_BAD, 0},
|
||||
{"loyal", fldoff(sct_loyal), NSC_UCHAR, 0, NULL, EF_BAD, NSC_DEITY},
|
||||
{"terr", fldoff(sct_terr), NSC_UCHAR, 0, NULL, EF_BAD, 0},
|
||||
{"terr0", fldoff(sct_terr), NSC_UCHAR, 0, NULL, EF_BAD, NSC_EXTRA},
|
||||
{"terr", 0, NSC_UCHAR, 0, nsc_sct_terr, EF_BAD, NSC_EXTRA},
|
||||
{"terr0", fldoff(sct_terr), NSC_UCHAR, 0, NULL, EF_BAD, 0},
|
||||
{"terr1", fldoff(sct_terr1), NSC_UCHAR, 0, NULL, EF_BAD, 0},
|
||||
{"terr2", fldoff(sct_terr2), NSC_UCHAR, 0, NULL, EF_BAD, 0},
|
||||
{"terr3", fldoff(sct_terr3), NSC_UCHAR, 0, NULL, EF_BAD, 0},
|
||||
|
@ -756,6 +757,17 @@ nsc_ver_maxnoc(struct valstr *val, struct natstr *np, void *ptr)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static void *
|
||||
nsc_sct_terr(struct valstr *val, struct natstr *np, void *ptr)
|
||||
{
|
||||
if (!np || np->nat_stat == STAT_GOD)
|
||||
val->val_as.sym.off = offsetof(struct sctstr, sct_dterr);
|
||||
else
|
||||
val->val_as.sym.off = offsetof(struct sctstr, sct_terr);
|
||||
val->val_as.sym.get = NULL;
|
||||
return ptr;
|
||||
}
|
||||
|
||||
static void *
|
||||
nsc_pln_def(struct valstr *val, struct natstr *np, void *ptr)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue