void C4AulScriptEngine::CompileFunc(StdCompiler *pComp, bool fScenarioSection, C4ValueNumbers * numbers) { if (!fScenarioSection) { assert(UserFiles.empty()); // user files must not be kept open C4ValueMapData GlobalNamedDefault; GlobalNamedDefault.SetNameList(&GlobalNamedNames); pComp->Value(mkNamingAdapt(mkParAdapt(GlobalNamed, numbers), "StaticVariables", GlobalNamedDefault)); pComp->Value(mkNamingAdapt(mkParAdapt(*GameScript.ScenPropList._getPropList(), numbers), "Scenario")); } if (pComp->isDeserializer() && pGlobalEffects) { // loading scenario section or game re-init: Merge effects // Must keep old effects here even if they're dead, because the LoadScenarioSection call typically came from execution of a global effect // and otherwise dead pointers would remain on the stack GlobalEffectsMergeCompileFunc(pComp, pGlobalEffects, "Effects", this, numbers); GlobalEffectsMergeCompileFunc(pComp, GameScript.pScenarioEffects, "ScenarioEffects", GameScript.ScenPropList._getPropList(), numbers); } else { // Otherwise, just compile effects pComp->Value(mkParAdapt(mkNamingPtrAdapt(pGlobalEffects, "Effects"), this, numbers)); pComp->Value(mkParAdapt(mkNamingPtrAdapt(GameScript.pScenarioEffects, "ScenarioEffects"), GameScript.ScenPropList._getPropList(), numbers)); } pComp->Value(mkNamingAdapt(*numbers, "Values")); }
void C4AulScriptEngine::CompileFunc(StdCompiler *pComp, C4ValueNumbers * numbers) { assert(UserFiles.empty()); // user files must not be kept open C4ValueMapData GlobalNamedDefault; GlobalNamedDefault.SetNameList(&GlobalNamedNames); pComp->Value(mkNamingAdapt(mkParAdapt(GlobalNamed, numbers), "StaticVariables", GlobalNamedDefault)); pComp->Value(mkNamingAdapt(mkParAdapt(*GameScript.ScenPropList._getPropList(), numbers), "Scenario")); }