mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-04 11:33:48 +00:00
feat(Core/Time): Implement saparated manager for game time (#8630)
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
#include "Battleground.h"
|
||||
#include "BattlegroundMgr.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "GameTime.h"
|
||||
#include "GroupMgr.h"
|
||||
#include "InstanceSaveMgr.h"
|
||||
#include "LFG.h"
|
||||
@@ -2410,3 +2411,14 @@ void Group::ToggleGroupMemberFlag(member_witerator slot, uint8 flag, bool apply)
|
||||
else
|
||||
slot->flags &= ~flag;
|
||||
}
|
||||
|
||||
uint32 Group::GetDifficultyChangePreventionTime() const
|
||||
{
|
||||
return _difficultyChangePreventionTime > GameTime::GetGameTime().count() ? _difficultyChangePreventionTime - GameTime::GetGameTime().count() : 0;
|
||||
}
|
||||
|
||||
void Group::SetDifficultyChangePrevention(DifficultyPreventionChangeType type)
|
||||
{
|
||||
_difficultyChangePreventionTime = GameTime::GetGameTime().count() + MINUTE;
|
||||
_difficultyChangePreventionType = type;
|
||||
}
|
||||
|
||||
@@ -309,13 +309,9 @@ public:
|
||||
bool IsLfgHeroic() const { return isLFGGroup() && (m_lfgGroupFlags & GROUP_LFG_FLAG_IS_HEROIC); }
|
||||
|
||||
// Difficulty Change
|
||||
uint32 GetDifficultyChangePreventionTime() const { return _difficultyChangePreventionTime > time(nullptr) ? _difficultyChangePreventionTime - time(nullptr) : 0; }
|
||||
uint32 GetDifficultyChangePreventionTime() const;
|
||||
DifficultyPreventionChangeType GetDifficultyChangePreventionReason() const { return _difficultyChangePreventionType; }
|
||||
void SetDifficultyChangePrevention(DifficultyPreventionChangeType type)
|
||||
{
|
||||
_difficultyChangePreventionTime = time(nullptr) + MINUTE;
|
||||
_difficultyChangePreventionType = type;
|
||||
}
|
||||
void SetDifficultyChangePrevention(DifficultyPreventionChangeType type);
|
||||
|
||||
protected:
|
||||
void _homebindIfInstance(Player* player);
|
||||
|
||||
Reference in New Issue
Block a user