forked from github/server
Eliminate dead code: FFL_NOTIMEOUT.
old feature for time-limited factions, not used anywhere.
This commit is contained in:
parent
7df47fd25c
commit
559f1f905a
|
@ -49,10 +49,10 @@ extern "C" {
|
||||||
#define FFL_NOIDLEOUT (1<<24) /* Partei stirbt nicht an NMRs */
|
#define FFL_NOIDLEOUT (1<<24) /* Partei stirbt nicht an NMRs */
|
||||||
#define FFL_NPC (1<<25) /* eine Partei mit Monstern */
|
#define FFL_NPC (1<<25) /* eine Partei mit Monstern */
|
||||||
#define FFL_DBENTRY (1<<28) /* Partei ist in Datenbank eingetragen */
|
#define FFL_DBENTRY (1<<28) /* Partei ist in Datenbank eingetragen */
|
||||||
#define FFL_NOTIMEOUT (1<<29) /* ignore MaxAge() */
|
|
||||||
#define FFL_GM (1<<30) /* eine Partei mit Sonderrechten */
|
#define FFL_GM (1<<30) /* eine Partei mit Sonderrechten */
|
||||||
|
|
||||||
#define FFL_SAVEMASK (FFL_DEFENDER|FFL_NEWID|FFL_GM|FFL_NPC|FFL_NOTIMEOUT|FFL_DBENTRY|FFL_NOIDLEOUT)
|
#define FFL_SAVEMASK (FFL_DEFENDER|FFL_NEWID|FFL_GM|FFL_NPC|FFL_DBENTRY|FFL_NOIDLEOUT)
|
||||||
|
|
||||||
#define is_monsters(f) ((f)->flags&FFL_NPC)
|
#define is_monsters(f) ((f)->flags&FFL_NPC)
|
||||||
|
|
||||||
|
|
|
@ -1312,7 +1312,7 @@ faction *readfaction(struct gamedata * data)
|
||||||
READ_INT(data->store, &f->flags);
|
READ_INT(data->store, &f->flags);
|
||||||
if (data->version < INTFLAGS_VERSION) {
|
if (data->version < INTFLAGS_VERSION) {
|
||||||
if (f->no == 0 || f->no == 666) {
|
if (f->no == 0 || f->no == 666) {
|
||||||
f->flags = FFL_NPC | FFL_NOTIMEOUT | FFL_NOIDLEOUT;
|
f->flags = FFL_NPC | FFL_NOIDLEOUT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
assert((f->flags&FFL_SAVEMASK) == f->flags);
|
assert((f->flags&FFL_SAVEMASK) == f->flags);
|
||||||
|
|
|
@ -1786,21 +1786,9 @@ int effskill(const unit * u, skill_t sk)
|
||||||
return eff_skill(u, sk, u->region);
|
return eff_skill(u, sk, u->region);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int MaxAge(void)
|
|
||||||
{
|
|
||||||
static int value = -1;
|
|
||||||
static int gamecookie = -1;
|
|
||||||
if (value < 0 || gamecookie != global.cookie) {
|
|
||||||
gamecookie = global.cookie;
|
|
||||||
value = get_param_int(global.parameters, "MaxAge", 0);
|
|
||||||
}
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
void remove_empty_units_in_region(region * r)
|
void remove_empty_units_in_region(region * r)
|
||||||
{
|
{
|
||||||
unit **up = &r->units;
|
unit **up = &r->units;
|
||||||
int max_age = MaxAge();
|
|
||||||
|
|
||||||
while (*up) {
|
while (*up) {
|
||||||
unit *u = *up;
|
unit *u = *up;
|
||||||
|
@ -1810,11 +1798,6 @@ void remove_empty_units_in_region(region * r)
|
||||||
if (f == NULL || !f->alive) {
|
if (f == NULL || !f->alive) {
|
||||||
set_number(u, 0);
|
set_number(u, 0);
|
||||||
}
|
}
|
||||||
if (max_age > 0) {
|
|
||||||
if ((!fval(f, FFL_NOTIMEOUT) && f->age > max_age)) {
|
|
||||||
set_number(u, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if ((u->number == 0 && u_race(u) != get_race(RC_SPELL)) || (u->age <= 0
|
if ((u->number == 0 && u_race(u) != get_race(RC_SPELL)) || (u->age <= 0
|
||||||
&& u_race(u) == get_race(RC_SPELL))) {
|
&& u_race(u) == get_race(RC_SPELL))) {
|
||||||
|
|
Loading…
Reference in New Issue