CMake: Use inherited dependencies in scripts

* Removes the circular dependency between game <-> scripts
This commit is contained in:
Aokromes committed 2016-08-10 00:33:48 +02:00
1 parent b96f20c0d4
commit 7ef9b246b5
7 files changed
+66 -125

No files matched your search

+11
View File
@@ -867,6 +867,15 @@ class TC_GAME_API 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();
@@ -1102,6 +1111,8 @@ class TC_GAME_API ScriptMgr
//atomic op counter for active scripts amount
std::atomic<uint32> _scheduledScripts;
ScriptLoaderCallbackType _script_loader_callback;
};
#endif