mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-02-05 16:39:08 +01:00
Few small optimizations here and there
This commit is contained in:
@@ -445,15 +445,16 @@ void WorldSession::HandleCalendarEventInvite(WorldPacket& recvData)
|
||||
}
|
||||
else
|
||||
{
|
||||
// Invitee offline, get data from database
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUID_RACE_ACC_BY_NAME);
|
||||
stmt->setString(0, name);
|
||||
if (PreparedQueryResult result = CharacterDatabase.Query(stmt))
|
||||
// Invitee offline, get data from storage
|
||||
ObjectGuid guid = sWorld->GetCharacterGuidByName(name);
|
||||
if (!guid.IsEmpty())
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
inviteeGuid = ObjectGuid(HighGuid::Player, fields[0].GetUInt32());
|
||||
inviteeTeam = Player::TeamForRace(fields[1].GetUInt8());
|
||||
inviteeGuildId = Player::GetGuildIdFromDB(inviteeGuid);
|
||||
if (CharacterInfo const* characterInfo = sWorld->GetCharacterInfo(guid))
|
||||
{
|
||||
inviteeGuid = guid;
|
||||
inviteeTeam = Player::TeamForRace(characterInfo->Race);
|
||||
inviteeGuildId = characterInfo->GuildId;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user