diff --git a/src/common/kernel/faction.c b/src/common/kernel/faction.c index 891692735..b54cc65e6 100644 --- a/src/common/kernel/faction.c +++ b/src/common/kernel/faction.c @@ -344,6 +344,7 @@ set_alliance(faction * a, faction * b, int status) void update_interval(struct faction * f, struct region * r) { + if (r==NULL || f==NULL) return; #ifdef ENUM_REGIONS if (f->first==NULL || f->first->index>r->index) { f->first = r; diff --git a/src/common/kernel/save.c b/src/common/kernel/save.c index 4a4f86b3c..63ccff7a5 100644 --- a/src/common/kernel/save.c +++ b/src/common/kernel/save.c @@ -1949,6 +1949,7 @@ readgame(const char * filename, int backup) assert(u->region==NULL); u->region = r; addlist2(up,u); + update_interval(u->faction, u->region); } } printf("\n"); diff --git a/src/common/kernel/unit.c b/src/common/kernel/unit.c index 486aede30..4aa25a04c 100644 --- a/src/common/kernel/unit.c +++ b/src/common/kernel/unit.c @@ -832,7 +832,7 @@ u_setfaction(unit * u, faction * f) u->prevF = NULL; u->faction = f; - update_interval(f, u->region); + if (u->region) update_interval(f, u->region); if (cnt && f) { set_number(u, cnt); if (playerrace(u->race)) {