mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
CMake: Use inherited dependencies in scripts
* Removes the circular dependency between game <-> scripts
(cherry picked from commit 96bc31924a)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user