From 63799d823dcb372431977e760f16931fa1ba3fd3 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 4 Mar 2012 19:29:32 -0800 Subject: [PATCH] hack to ignore otherfaction attributes if faction stealth is not allowed. --- src/attributes/otherfaction.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/attributes/otherfaction.c b/src/attributes/otherfaction.c index 706660c34..bd0b501fc 100644 --- a/src/attributes/otherfaction.c +++ b/src/attributes/otherfaction.c @@ -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) { /* return 1 on success, 0 if attrib needs removal */ - int of = store->r_int(store); - a->data.v = findfaction(of); - if (a->data.v) - return AT_READ_OK; + int of; + static int rule = -1; + if (rule<0) { + 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; }