From c0c71cbfb11d2552bb9e31daf61b97fcab002396 Mon Sep 17 00:00:00 2001 From: Christian Schlittchen Date: Sun, 24 Mar 2002 08:37:07 +0000 Subject: [PATCH] =?UTF-8?q?-=20Workaround=20f=C3=BCr=20falsches=20a=5Fothe?= =?UTF-8?q?rfaction?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/kernel/reports.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/common/kernel/reports.c b/src/common/kernel/reports.c index 885779e34..5476bfb46 100644 --- a/src/common/kernel/reports.c +++ b/src/common/kernel/reports.c @@ -847,7 +847,14 @@ visible_faction(const faction *f, const unit * u) { if(!allied(u, f, HELP_FSTEALTH)) { attrib *a = a_find(u->attribs, &at_otherfaction); - if (a) return get_otherfaction(a); + if (a) { + faction *fv = get_otherfaction(a); + if(fv != NULL) { + return fv; /* fv should never be NULL! */ + } else { + a_removeall(&u->attribs, &at_otherfaction); /* workaround, if this is triggered, it's a bug */ + } + } } return u->faction; }