Core/Misc: move scheduled scripts counter to ScriptMgr (which is more logical, isn't it?)

This commit is contained in:
zergtmn
2011-04-13 12:07:20 +06:00
committed by Azazel
parent e196dd80bd
commit 1551b8a011
9 changed files with 34 additions and 33 deletions

View File

@@ -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.