mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-02-10 03:59:05 +01:00
Core/Misc: move scheduled scripts counter to ScriptMgr (which is more logical, isn't it?)
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
|
||||
#include "Common.h"
|
||||
#include <ace/Singleton.h>
|
||||
#include <ace/Atomic_Op.h>
|
||||
|
||||
#include "DBCStores.h"
|
||||
#include "Player.h"
|
||||
@@ -766,6 +767,9 @@ class ScriptMgr
|
||||
|
||||
uint32 _scriptCount;
|
||||
|
||||
//atomic op counter for active scripts amount
|
||||
ACE_Atomic_Op<ACE_Thread_Mutex, long> _scheduledScripts;
|
||||
|
||||
public: /* Initialization */
|
||||
|
||||
void Initialize();
|
||||
@@ -971,6 +975,12 @@ class ScriptMgr
|
||||
void OnGroupChangeLeader(Group* group, uint64 newLeaderGuid, uint64 oldLeaderGuid);
|
||||
void OnGroupDisband(Group* group);
|
||||
|
||||
public: /* Scheduled scripts */
|
||||
uint32 IncreaseScheduledScriptsCount() { return uint32(++_scheduledScripts); }
|
||||
uint32 DecreaseScheduledScriptCount() { return uint32(--_scheduledScripts); }
|
||||
uint32 DecreaseScheduledScriptCount(size_t count) { return uint32(_scheduledScripts -= count); }
|
||||
bool IsScriptScheduled() const { return _scheduledScripts > 0; }
|
||||
|
||||
public: /* ScriptRegistry */
|
||||
|
||||
// This is the global static registry of scripts.
|
||||
|
||||
Reference in New Issue
Block a user