- properly write out the genPatrolStates in savegames.

This commit is contained in:
Christoph Oelckers 2021-09-10 23:52:05 +02:00
parent f370c0f22f
commit 64b67291bc

View file

@ -403,10 +403,15 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, AISTATE*& w, AISTA
if (w == cstate) if (w == cstate)
{ {
arc(keyname, i); arc(keyname, i);
break; return arc;
} }
i++; i++;
} }
if (w >= genPatrolStates && w < genPatrolStates + kPatrolStateSize)
{
i = int(w - genPatrolStates) + 1000;
arc(keyname, i);
}
} }
else else
{ {
@ -415,6 +420,10 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, AISTATE*& w, AISTA
{ {
w = allAIStates[i]; w = allAIStates[i];
} }
else if (i >= 1000 && i < 1000 + kPatrolStateSize)
{
w = genPatrolStates + i;
}
else else
{ {
w = nullptr; w = nullptr;