From edfa266a3284598c3e1364f35e93b1301a83775d Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 6 Aug 2011 13:56:46 -0700 Subject: [PATCH] Fix a crash in turn 733: alps sometimes have weird messages (also, unitmessage is dumb) --- src/triggers/unitmessage.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/triggers/unitmessage.c b/src/triggers/unitmessage.c index 4fa83dff0..6c26fe6a5 100644 --- a/src/triggers/unitmessage.c +++ b/src/triggers/unitmessage.c @@ -63,8 +63,12 @@ static int unitmessage_handle(trigger * t, void *data) unitmessage_data *td = (unitmessage_data *) t->data.v; if (td->target && td->target->no) { struct faction *f = td->target->faction; - addmessage(td->target->region, f, LOC(f->locale, td->string), td->type, - td->level); + const char * str = LOC(f->locale, td->string); + /* bug found in turn 733: sometimes, alps have f*cked up messages */ + if (td->string && td->string[0]) { + addmessage(td->target->region, f, str, td->type, + td->level); + } } unused(data); return 0;