forked from github/server
fix a crash in write_game caused by remove_empty_factions
https://bugs.eressea.de/view.php?id=2201
This commit is contained in:
parent
bc8c39f4bb
commit
30b3cff657
|
@ -1,3 +1,3 @@
|
|||
#define VERSION_MAJOR 3
|
||||
#define VERSION_MINOR 8
|
||||
#define VERSION_BUILD 7
|
||||
#define VERSION_BUILD 8
|
||||
|
|
|
@ -74,9 +74,6 @@ faction *factions;
|
|||
static void free_faction(faction * f)
|
||||
{
|
||||
funhash(f);
|
||||
if (f->alliance && f->alliance->_leader == f) {
|
||||
setalliance(f, 0);
|
||||
}
|
||||
if (f->msgs) {
|
||||
free_messagelist(f->msgs->begin);
|
||||
free(f->msgs);
|
||||
|
@ -454,7 +451,7 @@ void destroyfaction(faction ** fp)
|
|||
}
|
||||
#endif
|
||||
|
||||
if (f->alliance && f->alliance->_leader == f) {
|
||||
if (f->alliance) {
|
||||
setalliance(f, 0);
|
||||
}
|
||||
|
||||
|
@ -681,8 +678,6 @@ void remove_empty_factions(void)
|
|||
if (!(f->_alive && f->units!=NULL) && !fval(f, FFL_NOIDLEOUT)) {
|
||||
log_debug("dead: %s", factionname(f));
|
||||
destroyfaction(fp);
|
||||
free_faction(f);
|
||||
free(f);
|
||||
}
|
||||
else {
|
||||
fp = &(*fp)->next;
|
||||
|
|
Loading…
Reference in New Issue