mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-02-03 23:57:10 +01:00
Core/Misc: Moved CharacterInfo out of world to separate class
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
|
||||
#include "AccountMgr.h"
|
||||
#include "CellImpl.h"
|
||||
#include "CharacterCache.h"
|
||||
#include "Chat.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "Language.h"
|
||||
@@ -89,7 +90,7 @@ bool ChatHandler::HasLowerSecurity(Player* target, ObjectGuid guid, bool strong)
|
||||
if (target)
|
||||
target_session = target->GetSession();
|
||||
else if (!guid.IsEmpty())
|
||||
target_account = sObjectMgr->GetPlayerAccountIdByGUID(guid);
|
||||
target_account = sCharacterCache->GetCharacterAccountIdByGuid(guid);
|
||||
|
||||
if (!target_session && !target_account)
|
||||
{
|
||||
@@ -1049,10 +1050,9 @@ ObjectGuid::LowType ChatHandler::extractLowGuidFromLink(char* text, HighGuid& gu
|
||||
if (Player* player = ObjectAccessor::FindPlayerByName(name))
|
||||
return player->GetGUID().GetCounter();
|
||||
|
||||
if (ObjectGuid guid = sWorld->GetCharacterGuidByName(name))
|
||||
return guid.GetCounter();
|
||||
ObjectGuid guid = sCharacterCache->GetCharacterGuidByName(name);
|
||||
return guid.GetCounter();
|
||||
|
||||
return 0;
|
||||
}
|
||||
case GUID_LINK_CREATURE:
|
||||
{
|
||||
@@ -1105,7 +1105,7 @@ bool ChatHandler::extractPlayerTarget(char* args, Player** player, ObjectGuid* p
|
||||
*player = pl;
|
||||
|
||||
// if need guid value from DB (in name case for check player existence)
|
||||
ObjectGuid guid = !pl && (player_guid || player_name) ? sWorld->GetCharacterGuidByName(name) : ObjectGuid::Empty;
|
||||
ObjectGuid guid = !pl && (player_guid || player_name) ? sCharacterCache->GetCharacterGuidByName(name) : ObjectGuid::Empty;
|
||||
|
||||
// if allowed player guid (if no then only online players allowed)
|
||||
if (player_guid)
|
||||
@@ -1274,7 +1274,7 @@ bool ChatHandler::GetPlayerGroupAndGUIDByName(char const* cname, Player*& player
|
||||
|
||||
player = ObjectAccessor::FindPlayerByName(name);
|
||||
if (offline)
|
||||
guid = sWorld->GetCharacterGuidByName(name);
|
||||
guid = sCharacterCache->GetCharacterGuidByName(name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user