refactor(Core/Cache): move the GlobalPlayerCache to its own class (#9166)

This commit is contained in:
Skjalf
2021-11-18 12:53:36 -03:00
committed by GitHub
parent 00dc369cb6
commit 731d256420
47 changed files with 898 additions and 595 deletions

View File

@@ -23,6 +23,7 @@ Category: commandscripts
EndScriptData */
#include "AccountMgr.h"
#include "CharacterCache.h"
#include "Chat.h"
#include "GameEventMgr.h"
#include "ObjectAccessor.h"
@@ -1615,11 +1616,11 @@ public:
uint8 plevel = 0, prace = 0, pclass = 0;
bool online = ObjectAccessor::FindPlayerByLowGUID(guid) != nullptr;
if (const GlobalPlayerData* gpd = sWorld->GetGlobalPlayerData(guid))
if (CharacterCacheEntry const* gpd = sCharacterCache->GetCharacterCacheByName(name))
{
plevel = gpd->level;
prace = gpd->race;
pclass = gpd->playerClass;
plevel = gpd->Level;
prace = gpd->Race;
pclass = gpd->Class;
}
if (plevel > 0 && prace > 0 && prace <= RACE_DRAENEI && pclass > 0 && pclass <= CLASS_DRUID)