1
0
forked from 0ad/0ad

Properly check loaded scripts in the second simulation instance of a serialization test. Fixes #3238

This was SVN commit r16925.
This commit is contained in:
Nicolas Auvray 2015-08-20 12:52:29 +00:00
parent 1ab3a4a02d
commit b2e8a241d2

View File

@ -366,7 +366,8 @@ void CSimulation2Impl::Update(int turnLength, const std::vector<SimulationComman
secondaryContext.m_Terrain = &secondaryTerrain;
CComponentManager secondaryComponentManager(secondaryContext, scriptInterface.GetRuntime());
secondaryComponentManager.LoadComponentTypes();
ENSURE(LoadDefaultScripts(secondaryComponentManager, NULL));
std::set<VfsPath> secondaryLoadedScripts;
ENSURE(LoadDefaultScripts(secondaryComponentManager, &secondaryLoadedScripts));
ResetComponentState(secondaryComponentManager, false, false);
// Load the trigger scripts after we have loaded the simulation.
@ -376,7 +377,7 @@ void CSimulation2Impl::Update(int turnLength, const std::vector<SimulationComman
JS::RootedValue mapSettingsCloned(cx2,
secondaryComponentManager.GetScriptInterface().CloneValueFromOtherContext(
scriptInterface, m_MapSettings));
ENSURE(LoadTriggerScripts(secondaryComponentManager, mapSettingsCloned, &m_LoadedScripts));
ENSURE(LoadTriggerScripts(secondaryComponentManager, mapSettingsCloned, &secondaryLoadedScripts));
}
// Load the map into the secondary simulation