Merge pull request #339 from TurnerSE/improvement/CID22481

Improvement/cid22481
This commit is contained in:
Enno Rehling 2015-11-03 13:08:03 +01:00
commit 7e81b98fa4
1 changed files with 8 additions and 2 deletions

View File

@ -1346,8 +1346,14 @@ 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; int no;
int status = alliedfaction(NULL, f, sf->faction, HELP_ALL); int status;
assert(sf->faction);
no = sf->faction->no;
status = alliedfaction(NULL, f, sf->faction, HELP_ALL);
if (status != 0) { if (status != 0) {
WRITE_INT(data->store, no); WRITE_INT(data->store, no);
WRITE_INT(data->store, sf->status); WRITE_INT(data->store, sf->status);