Description:
After loading a save, the AI group’s persisted waypoint queue is restored correctly, but SCR_ScenarioFrameworkSlotAI.m_bWaypointsInitialized remains false.
InitOtherThings() therefore calls InitWaypoints() again, adding all configured waypoints a second time.
Cause:
SCR_ScenarioFrameworkSlotAISave.OnGroupAvailable() checks GetCurrentWaypoint() before SCR_AIGroupSerializer has finished restoring the waypoint queue.
Result:
The AI group receives duplicate waypoints after every save load.
Suggested Fix:
In SCR_ScenarioFrameworkSlotAI.InitOtherThings(), check whether the restored AI group already has a current waypoint before initializing the configured waypoints again:
override bool InitOtherThings()
{
if (m_AIGroup && m_AIGroup.GetCurrentWaypoint())
m_bWaypointsInitialized = true;
return super.InitOtherThings();
}
This prevents InitWaypoints() from adding the configured waypoint queue again after it has already been restored by SCR_AIGroupSerializer.