Fix a crash in turn 733: alps sometimes have weird messages (also, unitmessage is dumb)

This commit is contained in:
Enno Rehling 2011-08-06 13:56:46 -07:00
parent 21b8ab2d31
commit edfa266a32

View file

@ -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;