CMake: Use inherited dependencies in scripts

* Removes the circular dependency between game <-> scripts

(cherry picked from commit 96bc31924a)
This commit is contained in:
Naios
2016-03-16 15:34:25 +01:00
parent 5fe83abbe5
commit 28d8f7f70d
7 changed files with 66 additions and 126 deletions

View File

@@ -863,6 +863,15 @@ class ScriptMgr
void IncrementScriptCount() { ++_scriptCount; }
uint32 GetScriptCount() const { return _scriptCount; }
typedef void(*ScriptLoaderCallbackType)();
/// Sets the script loader callback which is invoked to load scripts
/// (Workaround for circular dependency game <-> scripts)
void SetScriptLoader(ScriptLoaderCallbackType script_loader_callback)
{
_script_loader_callback = script_loader_callback;
}
public: /* Unloading */
void Unload();
@@ -1097,6 +1106,8 @@ class ScriptMgr
//atomic op counter for active scripts amount
std::atomic<uint64> _scheduledScripts;
ScriptLoaderCallbackType _script_loader_callback;
};
#endif