forked from Mirrors/openclonk
Make the ScriptEngine not a C4AulScript
Every script has its own C4ScriptHost, the ScriptEngine doesn't use anything from C4AulScript.liquid_container
parent
473415bafa
commit
9dafc6424b
|
@ -88,10 +88,6 @@ C4AulScriptEngine::C4AulScriptEngine():
|
|||
GlobalPropList(C4PropList::NewStatic(NULL, NULL, ::Strings.RegString("Global"))),
|
||||
warnCnt(0), errCnt(0), lineCnt(0)
|
||||
{
|
||||
// /me r b engine
|
||||
Engine = this;
|
||||
ScriptName.Ref(C4CFN_System);
|
||||
|
||||
GlobalNamedNames.Reset();
|
||||
GlobalNamed.Reset();
|
||||
GlobalNamed.SetNameList(&GlobalNamedNames);
|
||||
|
|
|
@ -123,7 +123,7 @@ protected:
|
|||
};
|
||||
|
||||
// holds all C4AulScripts
|
||||
class C4AulScriptEngine : public C4AulScript
|
||||
class C4AulScriptEngine
|
||||
{
|
||||
protected:
|
||||
C4AulFuncMap FuncLookUp;
|
||||
|
@ -157,10 +157,9 @@ public:
|
|||
void Clear(); // clear data
|
||||
void Link(C4DefList *rDefs); // link and parse all scripts
|
||||
void ReLink(C4DefList *rDefs); // unlink, link and parse all scripts
|
||||
virtual C4PropListStatic * GetPropList();
|
||||
C4PropListStatic * GetPropList();
|
||||
C4Value Call(const char * k, C4AulParSet *pPars=0, bool fPassErrors=false)
|
||||
{ return GetPropList()->Call(k, pPars, fPassErrors); }
|
||||
using C4AulScript::ReloadScript;
|
||||
bool ReloadScript(const char *szScript, const char *szLanguage); // search script and reload, if found
|
||||
|
||||
// For the list of functions in the PropertyDlg
|
||||
|
|
|
@ -1027,13 +1027,13 @@ C4Value C4AulExec::DirectExec(C4PropList *p, const char *szScript, const char *s
|
|||
#endif
|
||||
// profiler
|
||||
StartDirectExec();
|
||||
C4AulScript * script = &::GameScript;
|
||||
C4ScriptHost * script = &::GameScript;
|
||||
if (p == ::ScriptEngine.GetPropList())
|
||||
script = &::ScriptEngine;
|
||||
script = NULL;
|
||||
else if (p && p->GetDef())
|
||||
script = &p->GetDef()->Script;
|
||||
// Add a new function
|
||||
C4AulScriptFunc *pFunc = new C4AulScriptFunc(script->GetPropList(), script->GetScriptHost(), 0, szScript);
|
||||
C4AulScriptFunc *pFunc = new C4AulScriptFunc(script ? script->GetPropList() : p->IsStatic(), script, 0, szScript);
|
||||
// Parse function
|
||||
try
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue