hack to ignore otherfaction attributes if faction stealth is not allowed.

This commit is contained in:
Enno Rehling 2012-03-04 19:29:32 -08:00
parent 52013f0e7c
commit 63799d823d
1 changed files with 13 additions and 4 deletions

View File

@ -38,10 +38,19 @@ void write_of(const struct attrib *a, const void *owner, struct storage *store)
int read_of(struct attrib *a, void *owner, struct storage *store) int read_of(struct attrib *a, void *owner, struct storage *store)
{ /* return 1 on success, 0 if attrib needs removal */ { /* return 1 on success, 0 if attrib needs removal */
int of = store->r_int(store); int of;
a->data.v = findfaction(of); static int rule = -1;
if (a->data.v) if (rule<0) {
return AT_READ_OK; rule = rule_stealth_faction();
}
of = store->r_int(store);
if (rule&2) {
a->data.v = findfaction(of);
if (a->data.v) {
return AT_READ_OK;
}
}
return AT_READ_FAIL; return AT_READ_FAIL;
} }