forked from Mirrors/openclonk
Move GlobalNamed.SetNameList call after Link() into Link()
It isn't clear whether that call is necessary since the C4AulScriptEngine constructor already does this, but it is clear that duplicating the call all over is a bad idea.epoxy
parent
5be63d1e96
commit
9dadfba5af
|
@ -2426,9 +2426,6 @@ bool C4Game::LinkScriptEngine()
|
|||
|
||||
// update material pointers
|
||||
::MaterialMap.UpdateScriptPointers();
|
||||
|
||||
// Set name list for globals
|
||||
ScriptEngine.GlobalNamed.SetNameList(&ScriptEngine.GlobalNamedNames);
|
||||
|
||||
if (C4AulDebug *pDebug = C4AulDebug::GetDebugger())
|
||||
if (!pDebug->Listen(DebugPort, !!DebugWait))
|
||||
|
|
|
@ -130,8 +130,6 @@ C4MapgenHandle* c4_mapgen_handle_new_script(const char* filename, const char* so
|
|||
ScriptEngine.Link(&::Definitions);
|
||||
if(c4_log_handle_get_n_log_messages() > 1)
|
||||
throw std::runtime_error(c4_log_handle_get_first_log_message());
|
||||
// Set name list for globals
|
||||
ScriptEngine.GlobalNamed.SetNameList(&ScriptEngine.GlobalNamedNames);
|
||||
|
||||
// Generate map, fail if return error occurs
|
||||
c4_log_handle_clear();
|
||||
|
@ -248,8 +246,6 @@ C4MapgenHandle* c4_mapgen_handle_new(const char* filename, const char* source, c
|
|||
ScriptEngine.Link(&::Definitions);
|
||||
if(c4_log_handle_get_n_log_messages() > 1)
|
||||
throw std::runtime_error(c4_log_handle_get_first_log_message());
|
||||
// Set name list for globals
|
||||
ScriptEngine.GlobalNamed.SetNameList(&ScriptEngine.GlobalNamedNames);
|
||||
}
|
||||
|
||||
c4_log_handle_clear();
|
||||
|
|
|
@ -194,7 +194,8 @@ void C4AulScriptEngine::Link(C4DefList *rDefs)
|
|||
err.show();
|
||||
}
|
||||
|
||||
|
||||
// Set name list for globals (FIXME: is this necessary?)
|
||||
ScriptEngine.GlobalNamed.SetNameList(&ScriptEngine.GlobalNamedNames);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -43,8 +43,6 @@ C4Value RunLoadedC4Script()
|
|||
// Link script engine (resolve includes/appends, generate code)
|
||||
ScriptEngine.Link(NULL);
|
||||
|
||||
// Set name list for globals
|
||||
ScriptEngine.GlobalNamed.SetNameList(&ScriptEngine.GlobalNamedNames);
|
||||
C4Value result = GameScript.Call("Main");
|
||||
GameScript.Clear();
|
||||
ScriptEngine.Clear();
|
||||
|
|
|
@ -58,7 +58,6 @@ C4Value AulTest::RunCode(const char *code, bool wrap)
|
|||
|
||||
GameScript.LoadData(src.c_str(), wrapped.c_str(), NULL);
|
||||
ScriptEngine.Link(NULL);
|
||||
ScriptEngine.GlobalNamed.SetNameList(&ScriptEngine.GlobalNamedNames);
|
||||
|
||||
return GameScript.Call("Main", nullptr, true);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue