mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-02-03 23:57:10 +01:00
Few small optimizations here and there
This commit is contained in:
@@ -1040,7 +1040,7 @@ ObjectGuid ChatHandler::extractGuidFromLink(char* text)
|
||||
if (Player* player = ObjectAccessor::FindPlayerByName(name))
|
||||
return player->GetGUID();
|
||||
|
||||
if (ObjectGuid guid = sObjectMgr->GetPlayerGUIDByName(name))
|
||||
if (ObjectGuid guid = sWorld->GetCharacterGuidByName(name))
|
||||
return guid;
|
||||
|
||||
return ObjectGuid::Empty;
|
||||
@@ -1102,7 +1102,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) ? sObjectMgr->GetPlayerGUIDByName(name) : ObjectGuid::Empty;
|
||||
ObjectGuid guid = !pl && (player_guid || player_name) ? sWorld->GetCharacterGuidByName(name) : ObjectGuid::Empty;
|
||||
|
||||
// if allowed player guid (if no then only online players allowed)
|
||||
if (player_guid)
|
||||
@@ -1261,7 +1261,7 @@ bool ChatHandler::GetPlayerGroupAndGUIDByName(char const* cname, Player*& player
|
||||
|
||||
player = ObjectAccessor::FindPlayerByName(name);
|
||||
if (offline)
|
||||
guid = sObjectMgr->GetPlayerGUIDByName(name.c_str());
|
||||
guid = sWorld->GetCharacterGuidByName(name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user