added assert to check the faction-pointer

This commit is contained in:
Philipp Dreher 2015-11-01 21:43:18 +01:00
parent 491e5faed9
commit b107ddadf5
1 changed files with 3 additions and 1 deletions

View File

@ -1346,7 +1346,9 @@ void writefaction(struct gamedata *data, const faction * f)
WRITE_SECTION(data->store); WRITE_SECTION(data->store);
for (sf = f->allies; sf; sf = sf->next) { for (sf = f->allies; sf; sf = sf->next) {
int no = (sf->faction != NULL) ? sf->faction->no : 0; assert(sf->faction);
int no = sf->faction->no;
int status = alliedfaction(NULL, f, sf->faction, HELP_ALL); int status = alliedfaction(NULL, f, sf->faction, HELP_ALL);
if (status != 0) { if (status != 0) {
WRITE_INT(data->store, no); WRITE_INT(data->store, no);