Core/Entities: First batch of removing implicit conversions of ObjectGuid to uint64
This commit is contained in:
@@ -576,7 +576,8 @@ bool PetAI::CanAttack(Unit* target)
|
||||
|
||||
void PetAI::ReceiveEmote(Player* player, uint32 emote)
|
||||
{
|
||||
if (me->GetOwnerGUID() && me->GetOwnerGUID() == player->GetGUID())
|
||||
if (!me->GetOwnerGUID().IsEmpty() && me->GetOwnerGUID() == player->GetGUID())
|
||||
{
|
||||
switch (emote)
|
||||
{
|
||||
case TEXT_EMOTE_COWER:
|
||||
@@ -596,6 +597,7 @@ void PetAI::ReceiveEmote(Player* player, uint32 emote)
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_OMNICAST_GHOUL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void PetAI::ClearCharmInfoFlags()
|
||||
|
||||
@@ -66,7 +66,7 @@ void TotemAI::UpdateAI(uint32 /*diff*/)
|
||||
// SPELLMOD_RANGE not applied in this place just because not existence range mods for attacking totems
|
||||
|
||||
// pointer to appropriate target if found any
|
||||
Unit* victim = i_victimGuid ? ObjectAccessor::GetUnit(*me, i_victimGuid) : NULL;
|
||||
Unit* victim = !i_victimGuid.IsEmpty() ? ObjectAccessor::GetUnit(*me, i_victimGuid) : NULL;
|
||||
|
||||
// Search victim if no, not attackable, or out of range, or friendly (possible in case duel end)
|
||||
if (!victim ||
|
||||
|
||||
@@ -278,7 +278,7 @@ void npc_escortAI::UpdateAI(uint32 diff)
|
||||
}
|
||||
|
||||
//Check if player or any member of his group is within range
|
||||
if (HasEscortState(STATE_ESCORT_ESCORTING) && m_uiPlayerGUID && !me->GetVictim() && !HasEscortState(STATE_ESCORT_RETURNING))
|
||||
if (HasEscortState(STATE_ESCORT_ESCORTING) && !m_uiPlayerGUID.IsEmpty() && !me->GetVictim() && !HasEscortState(STATE_ESCORT_RETURNING))
|
||||
{
|
||||
if (m_uiPlayerCheckTimer <= diff)
|
||||
{
|
||||
|
||||
@@ -333,7 +333,7 @@ void SmartAI::UpdateAI(uint32 diff)
|
||||
UpdateDespawn(diff);
|
||||
|
||||
/// @todo move to void
|
||||
if (mFollowGuid)
|
||||
if (!mFollowGuid.IsEmpty())
|
||||
{
|
||||
if (mFollowArrivedTimer < diff)
|
||||
{
|
||||
@@ -435,7 +435,7 @@ void SmartAI::EnterEvadeMode()
|
||||
AddEscortState(SMART_ESCORT_RETURNING);
|
||||
ReturnToLastOOCPos();
|
||||
}
|
||||
else if (mFollowGuid)
|
||||
else if (!mFollowGuid.IsEmpty())
|
||||
{
|
||||
if (Unit* target = ObjectAccessor::GetUnit(*me, mFollowGuid))
|
||||
me->GetMotionMaster()->MoveFollow(target, mFollowDist, mFollowAngle);
|
||||
@@ -674,7 +674,7 @@ void SmartAI::OnCharmed(bool apply)
|
||||
{
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_CHARMED, NULL, 0, 0, apply);
|
||||
|
||||
if (!apply && !me->IsInEvadeMode() && me->GetCharmerGUID())
|
||||
if (!apply && !me->IsInEvadeMode() && !me->GetCharmerGUID().IsEmpty())
|
||||
if (Unit* charmer = ObjectAccessor::GetUnit(*me, me->GetCharmerGUID()))
|
||||
AttackStart(charmer);
|
||||
}
|
||||
|
||||
@@ -181,7 +181,7 @@ class SmartScript
|
||||
void OnReset();
|
||||
void ResetBaseObject()
|
||||
{
|
||||
if (meOrigGUID)
|
||||
if (!meOrigGUID.IsEmpty())
|
||||
{
|
||||
if (Creature* m = HashMapHolder<Creature>::Find(meOrigGUID))
|
||||
{
|
||||
@@ -189,7 +189,7 @@ class SmartScript
|
||||
go = NULL;
|
||||
}
|
||||
}
|
||||
if (goOrigGUID)
|
||||
if (!goOrigGUID.IsEmpty())
|
||||
{
|
||||
if (GameObject* o = HashMapHolder<GameObject>::Find(goOrigGUID))
|
||||
{
|
||||
|
||||
@@ -850,7 +850,7 @@ BfCapturePoint::BfCapturePoint(Battlefield* battlefield) : m_Bf(battlefield), m_
|
||||
|
||||
bool BfCapturePoint::HandlePlayerEnter(Player* player)
|
||||
{
|
||||
if (m_capturePointGUID)
|
||||
if (!m_capturePointGUID.IsEmpty())
|
||||
{
|
||||
if (GameObject* capturePoint = m_Bf->GetGameObject(m_capturePointGUID))
|
||||
{
|
||||
@@ -865,7 +865,7 @@ bool BfCapturePoint::HandlePlayerEnter(Player* player)
|
||||
|
||||
GuidSet::iterator BfCapturePoint::HandlePlayerLeave(Player* player)
|
||||
{
|
||||
if (m_capturePointGUID)
|
||||
if (!m_capturePointGUID.IsEmpty())
|
||||
if (GameObject* capturePoint = m_Bf->GetGameObject(m_capturePointGUID))
|
||||
player->SendUpdateWorldState(capturePoint->GetGOInfo()->capturePoint.worldState1, 0);
|
||||
|
||||
@@ -937,7 +937,7 @@ GameObject* BfCapturePoint::GetCapturePointGo()
|
||||
|
||||
bool BfCapturePoint::DelCapturePoint()
|
||||
{
|
||||
if (m_capturePointGUID)
|
||||
if (!m_capturePointGUID.IsEmpty())
|
||||
{
|
||||
if (GameObject* capturePoint = m_Bf->GetGameObject(m_capturePointGUID))
|
||||
{
|
||||
|
||||
@@ -292,7 +292,7 @@ void BattlefieldWG::UpdateCounterVehicle(bool init)
|
||||
void BattlefieldWG::OnBattleEnd(bool endByTimer)
|
||||
{
|
||||
// Remove relic
|
||||
if (m_titansRelicGUID)
|
||||
if (!m_titansRelicGUID.IsEmpty())
|
||||
if (GameObject* relic = GetGameObject(m_titansRelicGUID))
|
||||
relic->RemoveFromWorld();
|
||||
m_titansRelicGUID.Clear();
|
||||
|
||||
@@ -410,7 +410,7 @@ void ArenaTeam::Roster(WorldSession* session)
|
||||
{
|
||||
player = ObjectAccessor::FindConnectedPlayer(itr->Guid);
|
||||
|
||||
data << uint64(itr->Guid); // guid
|
||||
data << itr->Guid; // guid
|
||||
data << uint8((player ? 1 : 0)); // online flag
|
||||
data << itr->Name; // member name
|
||||
data << uint32((itr->Guid == GetCaptain() ? 0 : 1)); // captain flag 0 captain 1 member
|
||||
@@ -476,7 +476,7 @@ void ArenaTeam::Inspect(WorldSession* session, ObjectGuid guid)
|
||||
return;
|
||||
|
||||
WorldPacket data(MSG_INSPECT_ARENA_TEAMS, 8+1+4*6);
|
||||
data << uint64(guid); // player guid
|
||||
data << guid; // player guid
|
||||
data << uint8(GetSlot()); // slot (0...2)
|
||||
data << uint32(GetId()); // arena team id
|
||||
data << uint32(Stats.Rating); // rating
|
||||
@@ -539,8 +539,8 @@ void ArenaTeam::BroadcastEvent(ArenaTeamEvents event, ObjectGuid guid, uint8 str
|
||||
return;
|
||||
}
|
||||
|
||||
if (guid)
|
||||
data << uint64(guid);
|
||||
if (!guid.IsEmpty())
|
||||
data << guid;
|
||||
|
||||
BroadcastPacket(&data);
|
||||
|
||||
|
||||
@@ -635,7 +635,7 @@ void BattlegroundAB::Reset()
|
||||
}
|
||||
|
||||
for (uint8 i = 0; i < BG_AB_ALL_NODES_COUNT + 5; ++i)//+5 for aura triggers
|
||||
if (BgCreatures[i])
|
||||
if (!BgCreatures[i].IsEmpty())
|
||||
DelCreature(i);
|
||||
}
|
||||
|
||||
|
||||
@@ -765,7 +765,7 @@ void BattlegroundAV::DePopulateNode(BG_AV_Nodes node)
|
||||
if (BgCreatures[c_place+i])
|
||||
DelCreature(c_place+i);
|
||||
//spiritguide
|
||||
if (!IsTower(node) && BgCreatures[node])
|
||||
if (!IsTower(node) && !BgCreatures[node].IsEmpty())
|
||||
DelCreature(node);
|
||||
|
||||
//remove bonus honor aura trigger creature when node is lost
|
||||
|
||||
@@ -975,14 +975,15 @@ void BattlegroundSA::UpdateDemolisherSpawns()
|
||||
|
||||
void BattlegroundSA::SendTransportInit(Player* player)
|
||||
{
|
||||
if (BgObjects[BG_SA_BOAT_ONE] || BgObjects[BG_SA_BOAT_TWO])
|
||||
if (!BgObjects[BG_SA_BOAT_ONE].IsEmpty() || !BgObjects[BG_SA_BOAT_TWO].IsEmpty())
|
||||
{
|
||||
UpdateData transData(player->GetMapId());
|
||||
if (BgObjects[BG_SA_BOAT_ONE])
|
||||
|
||||
GetBGObject(BG_SA_BOAT_ONE)->BuildCreateUpdateBlockForPlayer(&transData, player);
|
||||
|
||||
if (BgObjects[BG_SA_BOAT_TWO])
|
||||
GetBGObject(BG_SA_BOAT_TWO)->BuildCreateUpdateBlockForPlayer(&transData, player);
|
||||
|
||||
WorldPacket packet;
|
||||
transData.BuildPacket(&packet);
|
||||
player->SendDirectMessage(&packet);
|
||||
|
||||
@@ -172,7 +172,7 @@ void CalendarMgr::RemoveEvent(uint64 eventId, ObjectGuid remover)
|
||||
|
||||
// guild events only? check invite status here?
|
||||
// When an event is deleted, all invited (accepted/declined? - verify) guildies are notified via in-game mail. (wowwiki)
|
||||
if (remover && invite->GetInviteeGUID() != remover)
|
||||
if (!remover.IsEmpty() && invite->GetInviteeGUID() != remover)
|
||||
mail.SendMailTo(trans, MailReceiver(invite->GetInviteeGUID().GetCounter()), calendarEvent, MAIL_CHECK_MASK_COPIED);
|
||||
|
||||
delete invite;
|
||||
@@ -529,7 +529,7 @@ void CalendarMgr::SendCalendarEventInviteAlert(CalendarEvent const& calendarEven
|
||||
data << uint64(invite.GetInviteId());
|
||||
|
||||
Guild* guild = sGuildMgr->GetGuildById(calendarEvent.GetGuildId());
|
||||
data << uint64(guild ? guild->GetGUID() : 0);
|
||||
data << (guild ? guild->GetGUID() : ObjectGuid::Empty);
|
||||
|
||||
data << uint8(invite.GetStatus());
|
||||
data << uint8(invite.GetRank());
|
||||
@@ -569,7 +569,7 @@ void CalendarMgr::SendCalendarEvent(ObjectGuid guid, CalendarEvent const& calend
|
||||
data.AppendPackedTime(calendarEvent.GetTimeZoneTime());
|
||||
|
||||
Guild* guild = sGuildMgr->GetGuildById(calendarEvent.GetGuildId());
|
||||
data << uint64(guild ? guild->GetGUID() : 0);
|
||||
data << (guild ? guild->GetGUID() : ObjectGuid::Empty);
|
||||
|
||||
data << uint32(eventInviteeList.size());
|
||||
for (CalendarInviteStore::const_iterator itr = eventInviteeList.begin(); itr != eventInviteeList.end(); ++itr)
|
||||
|
||||
@@ -552,7 +552,7 @@ void Channel::List(Player const* player)
|
||||
member->GetSession()->GetSecurity() <= AccountTypes(gmLevelInWhoList)) &&
|
||||
member->IsVisibleGloballyFor(player))
|
||||
{
|
||||
data << uint64(i->first);
|
||||
data << i->first;
|
||||
data << uint8(i->second.flags); // flags seems to be changed...
|
||||
++count;
|
||||
}
|
||||
@@ -762,13 +762,13 @@ void Channel::MakeNotifyPacket(WorldPacket* data, uint8 notify_type)
|
||||
void Channel::MakeJoined(WorldPacket* data, ObjectGuid guid)
|
||||
{
|
||||
MakeNotifyPacket(data, CHAT_JOINED_NOTICE);
|
||||
*data << uint64(guid);
|
||||
*data << guid;
|
||||
}
|
||||
|
||||
void Channel::MakeLeft(WorldPacket* data, ObjectGuid guid)
|
||||
{
|
||||
MakeNotifyPacket(data, CHAT_LEFT_NOTICE);
|
||||
*data << uint64(guid);
|
||||
*data << guid;
|
||||
}
|
||||
|
||||
void Channel::MakeYouJoined(WorldPacket* data)
|
||||
@@ -804,13 +804,13 @@ void Channel::MakeNotModerator(WorldPacket* data)
|
||||
void Channel::MakePasswordChanged(WorldPacket* data, ObjectGuid guid)
|
||||
{
|
||||
MakeNotifyPacket(data, CHAT_PASSWORD_CHANGED_NOTICE);
|
||||
*data << uint64(guid);
|
||||
*data << guid;
|
||||
}
|
||||
|
||||
void Channel::MakeOwnerChanged(WorldPacket* data, ObjectGuid guid)
|
||||
{
|
||||
MakeNotifyPacket(data, CHAT_OWNER_CHANGED_NOTICE);
|
||||
*data << uint64(guid);
|
||||
*data << guid;
|
||||
}
|
||||
|
||||
void Channel::MakePlayerNotFound(WorldPacket* data, std::string const& name)
|
||||
@@ -838,7 +838,7 @@ void Channel::MakeChannelOwner(WorldPacket* data)
|
||||
void Channel::MakeModeChange(WorldPacket* data, ObjectGuid guid, uint8 oldflags)
|
||||
{
|
||||
MakeNotifyPacket(data, CHAT_MODE_CHANGE_NOTICE);
|
||||
*data << uint64(guid);
|
||||
*data << guid;
|
||||
*data << uint8(oldflags);
|
||||
*data << uint8(GetPlayerFlags(guid));
|
||||
}
|
||||
@@ -846,13 +846,13 @@ void Channel::MakeModeChange(WorldPacket* data, ObjectGuid guid, uint8 oldflags)
|
||||
void Channel::MakeAnnouncementsOn(WorldPacket* data, ObjectGuid guid)
|
||||
{
|
||||
MakeNotifyPacket(data, CHAT_ANNOUNCEMENTS_ON_NOTICE);
|
||||
*data << uint64(guid);
|
||||
*data << guid;
|
||||
}
|
||||
|
||||
void Channel::MakeAnnouncementsOff(WorldPacket* data, ObjectGuid guid)
|
||||
{
|
||||
MakeNotifyPacket(data, CHAT_ANNOUNCEMENTS_OFF_NOTICE);
|
||||
*data << uint64(guid);
|
||||
*data << guid;
|
||||
}
|
||||
|
||||
void Channel::MakeMuted(WorldPacket* data)
|
||||
@@ -863,8 +863,8 @@ void Channel::MakeMuted(WorldPacket* data)
|
||||
void Channel::MakePlayerKicked(WorldPacket* data, ObjectGuid bad, ObjectGuid good)
|
||||
{
|
||||
MakeNotifyPacket(data, CHAT_PLAYER_KICKED_NOTICE);
|
||||
*data << uint64(bad);
|
||||
*data << uint64(good);
|
||||
*data << bad;
|
||||
*data << good;
|
||||
}
|
||||
|
||||
void Channel::MakeBanned(WorldPacket* data)
|
||||
@@ -875,15 +875,15 @@ void Channel::MakeBanned(WorldPacket* data)
|
||||
void Channel::MakePlayerBanned(WorldPacket* data, ObjectGuid bad, ObjectGuid good)
|
||||
{
|
||||
MakeNotifyPacket(data, CHAT_PLAYER_BANNED_NOTICE);
|
||||
*data << uint64(bad);
|
||||
*data << uint64(good);
|
||||
*data << bad;
|
||||
*data << good;
|
||||
}
|
||||
|
||||
void Channel::MakePlayerUnbanned(WorldPacket* data, ObjectGuid bad, ObjectGuid good)
|
||||
{
|
||||
MakeNotifyPacket(data, CHAT_PLAYER_UNBANNED_NOTICE);
|
||||
*data << uint64(bad);
|
||||
*data << uint64(good);
|
||||
*data << bad;
|
||||
*data << good;
|
||||
}
|
||||
|
||||
void Channel::MakePlayerNotBanned(WorldPacket* data, const std::string &name)
|
||||
@@ -895,13 +895,13 @@ void Channel::MakePlayerNotBanned(WorldPacket* data, const std::string &name)
|
||||
void Channel::MakePlayerAlreadyMember(WorldPacket* data, ObjectGuid guid)
|
||||
{
|
||||
MakeNotifyPacket(data, CHAT_PLAYER_ALREADY_MEMBER_NOTICE);
|
||||
*data << uint64(guid);
|
||||
*data << guid;
|
||||
}
|
||||
|
||||
void Channel::MakeInvite(WorldPacket* data, ObjectGuid guid)
|
||||
{
|
||||
MakeNotifyPacket(data, CHAT_INVITE_NOTICE);
|
||||
*data << uint64(guid);
|
||||
*data << guid;
|
||||
}
|
||||
|
||||
void Channel::MakeInviteWrongFaction(WorldPacket* data)
|
||||
@@ -954,19 +954,19 @@ void Channel::MakeNotInLfg(WorldPacket* data)
|
||||
void Channel::MakeVoiceOn(WorldPacket* data, ObjectGuid guid)
|
||||
{
|
||||
MakeNotifyPacket(data, CHAT_VOICE_ON_NOTICE);
|
||||
*data << uint64(guid);
|
||||
*data << guid;
|
||||
}
|
||||
|
||||
void Channel::MakeVoiceOff(WorldPacket* data, ObjectGuid guid)
|
||||
{
|
||||
MakeNotifyPacket(data, CHAT_VOICE_OFF_NOTICE);
|
||||
*data << uint64(guid);
|
||||
*data << guid;
|
||||
}
|
||||
|
||||
void Channel::JoinNotify(ObjectGuid guid)
|
||||
{
|
||||
WorldPacket data(IsConstant() ? SMSG_USERLIST_ADD : SMSG_USERLIST_UPDATE, 8 + 1 + 1 + 4 + GetName().size());
|
||||
data << uint64(guid);
|
||||
data << guid;
|
||||
data << uint8(GetPlayerFlags(guid));
|
||||
data << uint8(GetFlags());
|
||||
data << uint32(GetNumPlayers());
|
||||
@@ -981,7 +981,7 @@ void Channel::JoinNotify(ObjectGuid guid)
|
||||
void Channel::LeaveNotify(ObjectGuid guid)
|
||||
{
|
||||
WorldPacket data(SMSG_USERLIST_REMOVE, 8 + 1 + 4 + GetName().size());
|
||||
data << uint64(guid);
|
||||
data << guid;
|
||||
data << uint8(GetFlags());
|
||||
data << uint32(GetNumPlayers());
|
||||
data << GetName();
|
||||
|
||||
@@ -637,7 +637,7 @@ size_t ChatHandler::BuildChatPacket(WorldPacket& data, ChatMsg chatType, Languag
|
||||
data.Initialize(!gmMessage ? SMSG_MESSAGECHAT : SMSG_GM_MESSAGECHAT);
|
||||
data << uint8(chatType);
|
||||
data << int32(language);
|
||||
data << uint64(senderGUID);
|
||||
data << senderGUID;
|
||||
data << uint32(0); // some flags
|
||||
switch (chatType)
|
||||
{
|
||||
@@ -652,8 +652,8 @@ size_t ChatHandler::BuildChatPacket(WorldPacket& data, ChatMsg chatType, Languag
|
||||
data << uint32(senderName.length() + 1);
|
||||
data << senderName;
|
||||
receiverGUIDPos = data.wpos();
|
||||
data << uint64(receiverGUID);
|
||||
if (receiverGUID && !receiverGUID.IsPlayer() && !receiverGUID.IsPet())
|
||||
data << receiverGUID;
|
||||
if (!receiverGUID.IsEmpty() && !receiverGUID.IsPlayer() && !receiverGUID.IsPet())
|
||||
{
|
||||
data << uint32(receiverName.length() + 1);
|
||||
data << receiverName;
|
||||
@@ -666,7 +666,7 @@ size_t ChatHandler::BuildChatPacket(WorldPacket& data, ChatMsg chatType, Languag
|
||||
data << uint32(senderName.length() + 1);
|
||||
data << senderName;
|
||||
receiverGUIDPos = data.wpos();
|
||||
data << uint64(receiverGUID);
|
||||
data << receiverGUID;
|
||||
if (language == LANG_ADDON)
|
||||
data << addonPrefix;
|
||||
break;
|
||||
@@ -674,8 +674,8 @@ size_t ChatHandler::BuildChatPacket(WorldPacket& data, ChatMsg chatType, Languag
|
||||
case CHAT_MSG_BG_SYSTEM_ALLIANCE:
|
||||
case CHAT_MSG_BG_SYSTEM_HORDE:
|
||||
receiverGUIDPos = data.wpos();
|
||||
data << uint64(receiverGUID);
|
||||
if (receiverGUID && !receiverGUID.IsPlayer())
|
||||
data << receiverGUID;
|
||||
if (!receiverGUID.IsEmpty() && !receiverGUID.IsPlayer())
|
||||
{
|
||||
data << uint32(receiverName.length() + 1);
|
||||
data << receiverName;
|
||||
@@ -687,7 +687,7 @@ size_t ChatHandler::BuildChatPacket(WorldPacket& data, ChatMsg chatType, Languag
|
||||
case CHAT_MSG_ACHIEVEMENT:
|
||||
case CHAT_MSG_GUILD_ACHIEVEMENT:
|
||||
receiverGUIDPos = data.wpos();
|
||||
data << uint64(receiverGUID);
|
||||
data << receiverGUID;
|
||||
if (language == LANG_ADDON)
|
||||
data << addonPrefix;
|
||||
break;
|
||||
@@ -705,7 +705,7 @@ size_t ChatHandler::BuildChatPacket(WorldPacket& data, ChatMsg chatType, Languag
|
||||
}
|
||||
|
||||
receiverGUIDPos = data.wpos();
|
||||
data << uint64(receiverGUID);
|
||||
data << receiverGUID;
|
||||
|
||||
if (language == LANG_ADDON)
|
||||
data << addonPrefix;
|
||||
@@ -1162,7 +1162,7 @@ bool ChatHandler::extractPlayerTarget(char* args, Player** player, ObjectGuid* p
|
||||
*player_guid = pl ? pl->GetGUID() : guid;
|
||||
|
||||
if (player_name)
|
||||
*player_name = pl || guid ? name : "";
|
||||
*player_name = pl || !guid.IsEmpty() ? name : "";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -665,7 +665,7 @@ void LFGMgr::UpdateRoleCheck(ObjectGuid gguid, ObjectGuid guid /* = ObjectGuid::
|
||||
return;
|
||||
|
||||
LfgRoleCheck& roleCheck = itRoleCheck->second;
|
||||
bool sendRoleChosen = roleCheck.state != LFG_ROLECHECK_DEFAULT && guid;
|
||||
bool sendRoleChosen = roleCheck.state != LFG_ROLECHECK_DEFAULT && !guid.IsEmpty();
|
||||
|
||||
if (!guid)
|
||||
roleCheck.state = LFG_ROLECHECK_ABORTED;
|
||||
@@ -862,7 +862,7 @@ void LFGMgr::MakeNewGroup(LfgProposal const& proposal)
|
||||
LFGDungeonData const* dungeon = GetLFGDungeon(proposal.dungeonId);
|
||||
ASSERT(dungeon);
|
||||
|
||||
Group* grp = proposal.group ? sGroupMgr->GetGroupByGUID(proposal.group.GetCounter()) : NULL;
|
||||
Group* grp = !proposal.group.IsEmpty() ? sGroupMgr->GetGroupByGUID(proposal.group.GetCounter()) : NULL;
|
||||
for (GuidList::const_iterator it = players.begin(); it != players.end(); ++it)
|
||||
{
|
||||
ObjectGuid pguid = (*it);
|
||||
@@ -1046,7 +1046,7 @@ void LFGMgr::RemoveProposal(LfgProposalContainer::iterator itProposal, LfgUpdate
|
||||
if (it->second.accept == LFG_ANSWER_AGREE)
|
||||
continue;
|
||||
|
||||
ObjectGuid guid = it->second.group ? it->second.group : it->first;
|
||||
ObjectGuid guid = !it->second.group.IsEmpty() ? it->second.group : it->first;
|
||||
// Player didn't accept or still pending when no secs left
|
||||
if (it->second.accept == LFG_ANSWER_DENY || type == LFG_UPDATETYPE_PROPOSAL_FAILED)
|
||||
{
|
||||
@@ -1059,7 +1059,7 @@ void LFGMgr::RemoveProposal(LfgProposalContainer::iterator itProposal, LfgUpdate
|
||||
for (LfgProposalPlayerContainer::const_iterator it = proposal.players.begin(); it != proposal.players.end(); ++it)
|
||||
{
|
||||
ObjectGuid guid = it->first;
|
||||
ObjectGuid gguid = it->second.group ? it->second.group : guid;
|
||||
ObjectGuid gguid = !it->second.group.IsEmpty() ? it->second.group : guid;
|
||||
|
||||
SendLfgUpdateProposal(guid, proposal);
|
||||
|
||||
@@ -1822,7 +1822,7 @@ void LFGMgr::SendLfgQueueStatus(ObjectGuid guid, LfgQueueStatusData const& data)
|
||||
|
||||
bool LFGMgr::IsLfgGroup(ObjectGuid guid)
|
||||
{
|
||||
return guid && guid.IsGroup() && GroupsStore[guid].IsLfgGroup();
|
||||
return !guid.IsEmpty() && guid.IsGroup() && GroupsStore[guid].IsLfgGroup();
|
||||
}
|
||||
|
||||
uint8 LFGMgr::GetQueueId(ObjectGuid guid)
|
||||
|
||||
@@ -520,7 +520,7 @@ LfgCompatibility LFGQueue::CheckCompatibility(GuidList check)
|
||||
LfgProposalPlayer &data = proposal.players[itRoles->first];
|
||||
data.role = itRoles->second;
|
||||
data.group = proposalGroups.find(itRoles->first)->second;
|
||||
if (!proposal.isNew && data.group && data.group == proposal.group) // Player from existing group, autoaccept
|
||||
if (!proposal.isNew && !data.group.IsEmpty() && data.group == proposal.group) // Player from existing group, autoaccept
|
||||
data.accept = LFG_ANSWER_AGREE;
|
||||
}
|
||||
|
||||
|
||||
@@ -528,7 +528,7 @@ void Creature::Update(uint32 diff)
|
||||
UpdateCharmAI();
|
||||
NeedChangeAI = false;
|
||||
IsAIEnabled = true;
|
||||
if (!IsInEvadeMode() && LastCharmerGUID)
|
||||
if (!IsInEvadeMode() && !LastCharmerGUID.IsEmpty())
|
||||
if (Unit* charmer = ObjectAccessor::GetUnit(*this, LastCharmerGUID))
|
||||
i_AI->AttackStart(charmer);
|
||||
|
||||
@@ -603,7 +603,7 @@ void Creature::RegenerateMana()
|
||||
uint32 addvalue = 0;
|
||||
|
||||
// Combat and any controlled creature
|
||||
if (IsInCombat() || GetCharmerOrOwnerGUID())
|
||||
if (IsInCombat() || !GetCharmerOrOwnerGUID().IsEmpty())
|
||||
{
|
||||
float ManaIncreaseRate = sWorld->getRate(RATE_POWER_MANA);
|
||||
float Spirit = GetStat(STAT_SPIRIT);
|
||||
@@ -1820,7 +1820,7 @@ void Creature::SendAIReaction(AiReaction reactionType)
|
||||
{
|
||||
WorldPacket data(SMSG_AI_REACTION, 12);
|
||||
|
||||
data << uint64(GetGUID());
|
||||
data << GetGUID();
|
||||
data << uint32(reactionType);
|
||||
|
||||
((WorldObject*)this)->SendMessageToSet(&data, true);
|
||||
|
||||
@@ -193,7 +193,7 @@ void PlayerMenu::SendGossipMenu(uint32 titleTextId, ObjectGuid objectGUID)
|
||||
_gossipMenu.SetSenderGUID(objectGUID);
|
||||
|
||||
WorldPacket data(SMSG_GOSSIP_MESSAGE, 100); // guess size
|
||||
data << uint64(objectGUID);
|
||||
data << objectGUID;
|
||||
data << uint32(_gossipMenu.GetMenuId()); // new 2.4.0
|
||||
data << uint32(titleTextId);
|
||||
data << uint32(_gossipMenu.GetMenuItemCount()); // max count 0x10
|
||||
@@ -326,7 +326,7 @@ void QuestMenu::ClearMenu()
|
||||
void PlayerMenu::SendQuestGiverQuestList(QEmote const& eEmote, const std::string& Title, ObjectGuid npcGUID)
|
||||
{
|
||||
WorldPacket data(SMSG_QUESTGIVER_QUEST_LIST, 100); // guess size
|
||||
data << uint64(npcGUID);
|
||||
data << npcGUID;
|
||||
data << Title;
|
||||
data << uint32(eEmote._Delay); // player emote
|
||||
data << uint32(eEmote._Emote); // NPC emote
|
||||
@@ -374,7 +374,7 @@ void PlayerMenu::SendQuestGiverQuestList(QEmote const& eEmote, const std::string
|
||||
void PlayerMenu::SendQuestGiverStatus(uint32 questStatus, ObjectGuid npcGUID) const
|
||||
{
|
||||
WorldPacket data(SMSG_QUESTGIVER_STATUS, 8 + 4);
|
||||
data << uint64(npcGUID);
|
||||
data << npcGUID;
|
||||
data << uint32(questStatus);
|
||||
|
||||
_session->SendPacket(&data);
|
||||
@@ -412,8 +412,8 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const* quest, ObjectGuid npcGU
|
||||
AddQuestLevelToTitle(questTitle, quest->GetQuestLevel());
|
||||
|
||||
WorldPacket data(SMSG_QUESTGIVER_QUEST_DETAILS, 100); // guess size
|
||||
data << uint64(npcGUID);
|
||||
data << uint64(_session->GetPlayer()->GetDivider());
|
||||
data << npcGUID;
|
||||
data << _session->GetPlayer()->GetDivider();
|
||||
data << uint32(quest->GetQuestId());
|
||||
data << questTitle;
|
||||
data << questDetails;
|
||||
@@ -642,7 +642,7 @@ void PlayerMenu::SendQuestGiverOfferReward(Quest const* quest, ObjectGuid npcGUI
|
||||
AddQuestLevelToTitle(questTitle, quest->GetQuestLevel());
|
||||
|
||||
WorldPacket data(SMSG_QUESTGIVER_OFFER_REWARD, 50); // guess size
|
||||
data << uint64(npcGUID);
|
||||
data << npcGUID;
|
||||
data << uint32(quest->GetQuestId());
|
||||
data << questTitle;
|
||||
data << questOfferRewardText;
|
||||
@@ -707,7 +707,7 @@ void PlayerMenu::SendQuestGiverRequestItems(Quest const* quest, ObjectGuid npcGU
|
||||
AddQuestLevelToTitle(questTitle, quest->GetQuestLevel());
|
||||
|
||||
WorldPacket data(SMSG_QUESTGIVER_REQUEST_ITEMS, 50); // guess size
|
||||
data << uint64(npcGUID);
|
||||
data << npcGUID;
|
||||
data << uint32(quest->GetQuestId());
|
||||
data << questTitle;
|
||||
data << requestItemsText;
|
||||
|
||||
@@ -36,12 +36,12 @@ m_timer(0), m_lifetime(0)
|
||||
|
||||
Unit* TempSummon::GetSummoner() const
|
||||
{
|
||||
return m_summonerGUID ? ObjectAccessor::GetUnit(*this, m_summonerGUID) : NULL;
|
||||
return !m_summonerGUID.IsEmpty() ? ObjectAccessor::GetUnit(*this, m_summonerGUID) : NULL;
|
||||
}
|
||||
|
||||
Creature* TempSummon::GetSummonerCreatureBase() const
|
||||
{
|
||||
return m_summonerGUID ? ObjectAccessor::GetCreature(*this, m_summonerGUID) : NULL;
|
||||
return !m_summonerGUID.IsEmpty() ? ObjectAccessor::GetCreature(*this, m_summonerGUID) : NULL;
|
||||
}
|
||||
|
||||
void TempSummon::Update(uint32 diff)
|
||||
@@ -201,7 +201,7 @@ void TempSummon::InitStats(uint32 duration)
|
||||
int32 slot = m_Properties->Slot;
|
||||
if (slot > 0)
|
||||
{
|
||||
if (owner->m_SummonSlot[slot] && owner->m_SummonSlot[slot] != GetGUID())
|
||||
if (!owner->m_SummonSlot[slot].IsEmpty() && owner->m_SummonSlot[slot] != GetGUID())
|
||||
{
|
||||
Creature* oldSummon = GetMap()->GetCreature(owner->m_SummonSlot[slot]);
|
||||
if (oldSummon && oldSummon->IsSummon())
|
||||
|
||||
@@ -634,7 +634,7 @@ void GameObject::Update(uint32 diff)
|
||||
|
||||
//! If this is summoned by a spell with ie. SPELL_EFFECT_SUMMON_OBJECT_WILD, with or without owner, we check respawn criteria based on spell
|
||||
//! The GetOwnerGUID() check is mostly for compatibility with hacky scripts - 99% of the time summoning should be done trough spells.
|
||||
if (GetSpellId() || GetOwnerGUID())
|
||||
if (GetSpellId() || !GetOwnerGUID().IsEmpty())
|
||||
{
|
||||
SetRespawnTime(0);
|
||||
Delete();
|
||||
|
||||
@@ -681,7 +681,7 @@ class GameObject : public WorldObject, public GridObject<GameObject>, public Map
|
||||
void SetOwnerGUID(ObjectGuid owner)
|
||||
{
|
||||
// Owner already found and different than expected owner - remove object from old owner
|
||||
if (owner && GetOwnerGUID() && GetOwnerGUID() != owner)
|
||||
if (!owner.IsEmpty() && !GetOwnerGUID().IsEmpty() && GetOwnerGUID() != owner)
|
||||
{
|
||||
ASSERT(false);
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
#include "Battleground.h"
|
||||
#include "Chat.h"
|
||||
|
||||
Object::Object() : m_PackGUID(sizeof(uint64)+1)
|
||||
Object::Object()
|
||||
{
|
||||
m_objectTypeId = TYPEID_OBJECT;
|
||||
m_objectType = TYPEMASK_OBJECT;
|
||||
@@ -375,7 +375,7 @@ void Object::BuildMovementUpdate(ByteBuffer* data, uint16 flags) const
|
||||
movementFlagsExtra = self->m_movementInfo.GetExtraMovementFlags();
|
||||
hasSpline = self->IsSplineEnabled();
|
||||
|
||||
hasTransportTime2 = self->m_movementInfo.transport.guid != 0 && self->m_movementInfo.transport.time2 != 0;
|
||||
hasTransportTime2 = !self->m_movementInfo.transport.guid.IsEmpty() && self->m_movementInfo.transport.time2 != 0;
|
||||
hasTransportTime3 = false;
|
||||
hasPitch = self->HasUnitMovementFlag(MovementFlags(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING)) || self->HasExtraUnitMovementFlag(MOVEMENTFLAG2_ALWAYS_ALLOW_PITCHING);
|
||||
hasFallDirection = self->HasUnitMovementFlag(MOVEMENTFLAG_FALLING);
|
||||
@@ -853,7 +853,7 @@ void Object::SetUInt64Value(uint16 index, uint64 value)
|
||||
bool Object::AddGuidValue(uint16 index, ObjectGuid value)
|
||||
{
|
||||
ASSERT(index + 1 < m_valuesCount || PrintIndexError(index, true));
|
||||
if (value && !*((ObjectGuid*)&(m_uint32Values[index])))
|
||||
if (!value.IsEmpty() && ((ObjectGuid*)&(m_uint32Values[index]))->IsEmpty())
|
||||
{
|
||||
*((ObjectGuid*)&(m_uint32Values[index])) = value;
|
||||
_changesMask.SetBit(index);
|
||||
@@ -874,7 +874,7 @@ bool Object::AddGuidValue(uint16 index, ObjectGuid value)
|
||||
bool Object::RemoveGuidValue(uint16 index, ObjectGuid value)
|
||||
{
|
||||
ASSERT(index + 1 < m_valuesCount || PrintIndexError(index, true));
|
||||
if (value && *((ObjectGuid*)&(m_uint32Values[index])) == value)
|
||||
if (!value.IsEmpty() && *((ObjectGuid*)&(m_uint32Values[index])) == value)
|
||||
{
|
||||
m_uint32Values[index] = 0;
|
||||
m_uint32Values[index + 1] = 0;
|
||||
|
||||
@@ -305,7 +305,7 @@ TradeData* TradeData::GetTraderData() const
|
||||
|
||||
Item* TradeData::GetItem(TradeSlots slot) const
|
||||
{
|
||||
return m_items[slot] ? m_player->GetItemByGuid(m_items[slot]) : NULL;
|
||||
return !m_items[slot].IsEmpty() ? m_player->GetItemByGuid(m_items[slot]) : NULL;
|
||||
}
|
||||
|
||||
bool TradeData::HasItem(ObjectGuid itemGuid) const
|
||||
@@ -328,7 +328,7 @@ TradeSlots TradeData::GetTradeSlotForItem(ObjectGuid itemGuid) const
|
||||
|
||||
Item* TradeData::GetSpellCastItem() const
|
||||
{
|
||||
return m_spellCastItem ? m_player->GetItemByGuid(m_spellCastItem) : NULL;
|
||||
return !m_spellCastItem.IsEmpty() ? m_player->GetItemByGuid(m_spellCastItem) : NULL;
|
||||
}
|
||||
|
||||
void TradeData::SetItem(TradeSlots slot, Item* item)
|
||||
@@ -3006,7 +3006,7 @@ void Player::RemoveFromGroup(Group* group, ObjectGuid guid, RemoveMethod method
|
||||
void Player::SendLogXPGain(uint32 GivenXP, Unit* victim, uint32 BonusXP, bool recruitAFriend, float /*group_rate*/)
|
||||
{
|
||||
WorldPacket data(SMSG_LOG_XPGAIN, 21); // guess size?
|
||||
data << uint64(victim ? victim->GetGUID() : ObjectGuid::Empty);
|
||||
data << (victim ? victim->GetGUID() : ObjectGuid::Empty);
|
||||
data << uint32(GivenXP + BonusXP); // given experience
|
||||
data << uint8(victim ? 0 : 1); // 00-kill_xp type, 01-non_kill_xp type
|
||||
|
||||
@@ -13343,8 +13343,8 @@ void Player::SendEquipError(InventoryResult msg, Item* pItem, Item* pItem2, uint
|
||||
|
||||
if (msg != EQUIP_ERR_OK)
|
||||
{
|
||||
data << uint64(pItem ? pItem->GetGUID() : ObjectGuid::Empty);
|
||||
data << uint64(pItem2 ? pItem2->GetGUID() : ObjectGuid::Empty);
|
||||
data << (pItem ? pItem->GetGUID() : ObjectGuid::Empty);
|
||||
data << (pItem2 ? pItem2->GetGUID() : ObjectGuid::Empty);
|
||||
data << uint8(0); // bag type subclass, used with EQUIP_ERR_EVENT_AUTOEQUIP_BIND_CONFIRM and EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG2
|
||||
|
||||
switch (msg)
|
||||
@@ -13382,7 +13382,7 @@ void Player::SendBuyError(BuyResult msg, Creature* creature, uint32 item, uint32
|
||||
{
|
||||
TC_LOG_DEBUG("network", "WORLD: Sent SMSG_BUY_FAILED");
|
||||
WorldPacket data(SMSG_BUY_FAILED, (8+4+4+1));
|
||||
data << uint64(creature ? creature->GetGUID() : ObjectGuid::Empty);
|
||||
data << (creature ? creature->GetGUID() : ObjectGuid::Empty);
|
||||
data << uint32(item);
|
||||
data << uint8(msg);
|
||||
GetSession()->SendPacket(&data);
|
||||
@@ -13392,7 +13392,7 @@ void Player::SendSellError(SellResult msg, Creature* creature, ObjectGuid guid)
|
||||
{
|
||||
TC_LOG_DEBUG("network", "WORLD: Sent SMSG_SELL_ITEM");
|
||||
WorldPacket data(SMSG_SELL_ITEM, (8+8+1)); // last check 4.3.4
|
||||
data << uint64(creature ? creature->GetGUID() : ObjectGuid::Empty);
|
||||
data << (creature ? creature->GetGUID() : ObjectGuid::Empty);
|
||||
data << uint64(guid);
|
||||
data << uint8(msg);
|
||||
GetSession()->SendPacket(&data);
|
||||
@@ -18312,7 +18312,7 @@ void Player::_LoadVoidStorage(PreparedQueryResult result)
|
||||
}
|
||||
|
||||
std::string name;
|
||||
if (creatorGuid && !sObjectMgr->GetPlayerNameByGUID(creatorGuid, name))
|
||||
if (!creatorGuid.IsEmpty() && !sObjectMgr->GetPlayerNameByGUID(creatorGuid, name))
|
||||
{
|
||||
TC_LOG_ERROR("entities.player", "Player::_LoadVoidStorage - Player (GUID: %u, name: %s) has an item with an invalid creator guid, set to 0 (item id: " UI64FMTD ", entry: %u, creator: %s).", GetGUIDLow(), GetName().c_str(), itemId, itemEntry, creatorGuid.ToString().c_str());
|
||||
creatorGuid.Clear();
|
||||
|
||||
@@ -1900,7 +1900,7 @@ class Player : public Unit, public GridObject<Player>
|
||||
_resurrectionData = NULL;
|
||||
}
|
||||
|
||||
bool IsResurrectRequestedBy(uint64 guid) const
|
||||
bool IsResurrectRequestedBy(ObjectGuid guid) const
|
||||
{
|
||||
if (!IsResurrectRequested())
|
||||
return false;
|
||||
|
||||
@@ -2996,7 +2996,7 @@ void Unit::DeMorph()
|
||||
|
||||
Aura* Unit::_TryStackingOrRefreshingExistingAura(SpellInfo const* newAura, uint8 effMask, Unit* caster, int32* baseAmount /*= NULL*/, Item* castItem /*= NULL*/, ObjectGuid casterGUID /*= 0*/)
|
||||
{
|
||||
ASSERT(casterGUID || caster);
|
||||
ASSERT(!casterGUID.IsEmpty() || caster);
|
||||
|
||||
// Check if these can stack anyway
|
||||
if (!casterGUID && !newAura->IsStackableOnOneSlotWithDifferentCasters())
|
||||
@@ -3996,7 +3996,7 @@ AuraEffect* Unit::GetAuraEffect(AuraType type, SpellFamilyNames family, uint32 f
|
||||
SpellInfo const* spell = (*i)->GetSpellInfo();
|
||||
if (spell->SpellFamilyName == uint32(family) && spell->SpellFamilyFlags.HasFlag(familyFlag1, familyFlag2, familyFlag3))
|
||||
{
|
||||
if (casterGUID && (*i)->GetCasterGUID() != casterGUID)
|
||||
if (!casterGUID.IsEmpty() && (*i)->GetCasterGUID() != casterGUID)
|
||||
continue;
|
||||
return (*i);
|
||||
}
|
||||
@@ -4630,7 +4630,7 @@ GameObject* Unit::GetGameObject(uint32 spellId) const
|
||||
|
||||
void Unit::AddGameObject(GameObject* gameObj)
|
||||
{
|
||||
if (!gameObj || gameObj->GetOwnerGUID())
|
||||
if (!gameObj || !gameObj->GetOwnerGUID().IsEmpty())
|
||||
return;
|
||||
|
||||
m_gameObj.push_back(gameObj);
|
||||
@@ -4949,7 +4949,7 @@ bool Unit::HandleAuraProcOnPowerAmount(Unit* victim, uint32 /*damage*/, AuraEffe
|
||||
Unit* target = NULL;
|
||||
int32 basepoints0 = 0;
|
||||
|
||||
Item* castItem = triggeredByAura->GetBase()->GetCastItemGUID() && GetTypeId() == TYPEID_PLAYER
|
||||
Item* castItem = !triggeredByAura->GetBase()->GetCastItemGUID().IsEmpty() && GetTypeId() == TYPEID_PLAYER
|
||||
? ToPlayer()->GetItemByGuid(triggeredByAura->GetBase()->GetCastItemGUID()) : NULL;
|
||||
|
||||
/* Try handle unknown trigger spells or with invalid power amount or misc value
|
||||
@@ -5064,7 +5064,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
|
||||
uint32 effIndex = triggeredByAura->GetEffIndex();
|
||||
int32 triggerAmount = triggeredByAura->GetAmount();
|
||||
|
||||
Item* castItem = triggeredByAura->GetBase()->GetCastItemGUID() && GetTypeId() == TYPEID_PLAYER
|
||||
Item* castItem = !triggeredByAura->GetBase()->GetCastItemGUID().IsEmpty() && GetTypeId() == TYPEID_PLAYER
|
||||
? ToPlayer()->GetItemByGuid(triggeredByAura->GetBase()->GetCastItemGUID()) : NULL;
|
||||
|
||||
uint32 triggered_spell_id = 0;
|
||||
@@ -6647,7 +6647,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
|
||||
if (triggeredByAura->GetAuraType() == SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE)
|
||||
basepoints0 = triggerAmount;
|
||||
|
||||
Item* castItem = triggeredByAura->GetBase()->GetCastItemGUID() && GetTypeId() == TYPEID_PLAYER
|
||||
Item* castItem = !triggeredByAura->GetBase()->GetCastItemGUID().IsEmpty() && GetTypeId() == TYPEID_PLAYER
|
||||
? ToPlayer()->GetItemByGuid(triggeredByAura->GetBase()->GetCastItemGUID()) : NULL;
|
||||
|
||||
// Try handle unknown trigger spells
|
||||
@@ -7149,7 +7149,7 @@ bool Unit::HandleOverrideClassScriptAuraProc(Unit* victim, uint32 /*damage*/, Au
|
||||
if (!victim || !victim->IsAlive())
|
||||
return false;
|
||||
|
||||
Item* castItem = triggeredByAura->GetBase()->GetCastItemGUID() && GetTypeId() == TYPEID_PLAYER
|
||||
Item* castItem = !triggeredByAura->GetBase()->GetCastItemGUID().IsEmpty() && GetTypeId() == TYPEID_PLAYER
|
||||
? ToPlayer()->GetItemByGuid(triggeredByAura->GetBase()->GetCastItemGUID()) : NULL;
|
||||
|
||||
uint32 triggered_spell_id = 0;
|
||||
@@ -7851,7 +7851,7 @@ Unit* Unit::GetCharm() const
|
||||
|
||||
Unit* Unit::GetCharmerOrOwner() const
|
||||
{
|
||||
return GetCharmerGUID() ? GetCharmer() : GetOwner();
|
||||
return !GetCharmerGUID().IsEmpty() ? GetCharmer() : GetOwner();
|
||||
}
|
||||
|
||||
Unit* Unit::GetCharmerOrOwnerOrSelf() const
|
||||
@@ -12831,7 +12831,7 @@ SpellSchoolMask Unit::GetMeleeDamageSchoolMask() const
|
||||
|
||||
ObjectGuid Unit::GetCharmerOrOwnerGUID() const
|
||||
{
|
||||
return GetCharmerGUID() ? GetCharmerGUID() : GetOwnerGUID();
|
||||
return !GetCharmerGUID().IsEmpty() ? GetCharmerGUID() : GetOwnerGUID();
|
||||
}
|
||||
|
||||
ObjectGuid Unit::GetCharmerOrOwnerOrOwnGUID() const
|
||||
@@ -14442,7 +14442,7 @@ void Unit::RestoreFaction()
|
||||
|
||||
Unit* Unit::GetRedirectThreatTarget()
|
||||
{
|
||||
return _redirectThreadInfo.GetTargetGUID() ? ObjectAccessor::GetUnit(*this, _redirectThreadInfo.GetTargetGUID()) : NULL;
|
||||
return !_redirectThreadInfo.GetTargetGUID().IsEmpty() ? ObjectAccessor::GetUnit(*this, _redirectThreadInfo.GetTargetGUID()) : NULL;
|
||||
}
|
||||
|
||||
bool Unit::CreateVehicleKit(uint32 id, uint32 creatureEntry)
|
||||
@@ -15593,7 +15593,7 @@ void Unit::WriteMovementInfo(WorldPacket& data, Movement::ExtraMovementStatusEle
|
||||
bool hasMovementFlags2 = GetExtraUnitMovementFlags() != 0;
|
||||
bool hasTimestamp = true;
|
||||
bool hasOrientation = !G3D::fuzzyEq(GetOrientation(), 0.0f);
|
||||
bool hasTransportData = GetTransGUID() != 0;
|
||||
bool hasTransportData = !GetTransGUID().IsEmpty();
|
||||
bool hasSpline = IsSplineEnabled();
|
||||
|
||||
bool hasTransportTime2 = hasTransportData && m_movementInfo.transport.time2 != 0;
|
||||
|
||||
@@ -555,7 +555,7 @@ bool Group::RemoveMember(ObjectGuid guid, const RemoveMethod& method /*= GROUP_R
|
||||
// Do we really need to send this opcode?
|
||||
data.Initialize(SMSG_GROUP_LIST, 1+1+1+1+8+4+4+8);
|
||||
data << uint8(0x10) << uint8(0) << uint8(0) << uint8(0);
|
||||
data << uint64(m_guid) << uint32(m_counter) << uint32(0) << uint64(0);
|
||||
data << m_guid << uint32(m_counter) << uint32(0) << uint64(0);
|
||||
player->GetSession()->SendPacket(&data);
|
||||
|
||||
_homebindIfInstance(player);
|
||||
@@ -759,7 +759,7 @@ void Group::Disband(bool hideDestroy /* = false */)
|
||||
{
|
||||
data.Initialize(SMSG_GROUP_LIST, 1+1+1+1+8+4+4+8);
|
||||
data << uint8(0x10) << uint8(0) << uint8(0) << uint8(0);
|
||||
data << uint64(m_guid) << uint32(m_counter) << uint32(0) << uint64(0);
|
||||
data << m_guid << uint32(m_counter) << uint32(0) << uint64(0);
|
||||
player->GetSession()->SendPacket(&data);
|
||||
}
|
||||
|
||||
@@ -805,7 +805,7 @@ void Group::Disband(bool hideDestroy /* = false */)
|
||||
void Group::SendLootStartRoll(uint32 countDown, uint32 mapid, const Roll &r)
|
||||
{
|
||||
WorldPacket data(SMSG_LOOT_START_ROLL, (8+4+4+4+4+4+4+1));
|
||||
data << uint64(r.itemGUID); // guid of rolled item
|
||||
data << r.itemGUID; // guid of rolled item
|
||||
data << uint32(mapid); // 3.3.3 mapid
|
||||
data << uint32(r.itemSlot); // itemslot
|
||||
data << uint32(r.itemid); // the itemEntryId for the item that shall be rolled for
|
||||
@@ -833,7 +833,7 @@ void Group::SendLootStartRollToPlayer(uint32 countDown, uint32 mapId, Player* p,
|
||||
return;
|
||||
|
||||
WorldPacket data(SMSG_LOOT_START_ROLL, (8 + 4 + 4 + 4 + 4 + 4 + 4 + 1));
|
||||
data << uint64(r.itemGUID); // guid of rolled item
|
||||
data << r.itemGUID; // guid of rolled item
|
||||
data << uint32(mapId); // 3.3.3 mapid
|
||||
data << uint32(r.itemSlot); // itemslot
|
||||
data << uint32(r.itemid); // the itemEntryId for the item that shall be rolled for
|
||||
@@ -853,9 +853,9 @@ void Group::SendLootStartRollToPlayer(uint32 countDown, uint32 mapId, Player* p,
|
||||
void Group::SendLootRoll(ObjectGuid sourceGuid, ObjectGuid targetGuid, uint8 rollNumber, uint8 rollType, Roll const& roll)
|
||||
{
|
||||
WorldPacket data(SMSG_LOOT_ROLL, (8+4+8+4+4+4+1+1+1));
|
||||
data << uint64(sourceGuid); // guid of the item rolled
|
||||
data << sourceGuid; // guid of the item rolled
|
||||
data << uint32(roll.itemSlot); // slot
|
||||
data << uint64(targetGuid);
|
||||
data << targetGuid;
|
||||
data << uint32(roll.itemid); // the itemEntryId for the item that shall be rolled for
|
||||
data << uint32(roll.itemRandomSuffix); // randomSuffix
|
||||
data << uint32(roll.itemRandomPropId); // Item random property ID
|
||||
@@ -877,12 +877,12 @@ void Group::SendLootRoll(ObjectGuid sourceGuid, ObjectGuid targetGuid, uint8 rol
|
||||
void Group::SendLootRollWon(ObjectGuid sourceGuid, ObjectGuid targetGuid, uint8 rollNumber, uint8 rollType, Roll const& roll)
|
||||
{
|
||||
WorldPacket data(SMSG_LOOT_ROLL_WON, (8+4+4+4+4+8+1+1));
|
||||
data << uint64(sourceGuid); // guid of the item rolled
|
||||
data << sourceGuid; // guid of the item rolled
|
||||
data << uint32(roll.itemSlot); // slot
|
||||
data << uint32(roll.itemid); // the itemEntryId for the item that shall be rolled for
|
||||
data << uint32(roll.itemRandomSuffix); // randomSuffix
|
||||
data << uint32(roll.itemRandomPropId); // Item random property
|
||||
data << uint64(targetGuid); // guid of the player who won.
|
||||
data << targetGuid; // guid of the player who won.
|
||||
data << uint32(rollNumber); // rollnumber realted to SMSG_LOOT_ROLL
|
||||
data << uint8(rollType); // rollType related to SMSG_LOOT_ROLL
|
||||
|
||||
@@ -900,7 +900,7 @@ void Group::SendLootRollWon(ObjectGuid sourceGuid, ObjectGuid targetGuid, uint8
|
||||
void Group::SendLootAllPassed(Roll const& roll)
|
||||
{
|
||||
WorldPacket data(SMSG_LOOT_ALL_PASSED, (8+4+4+4+4));
|
||||
data << uint64(roll.itemGUID); // Guid of the item rolled
|
||||
data << roll.itemGUID; // Guid of the item rolled
|
||||
data << uint32(roll.itemSlot); // Item loot slot
|
||||
data << uint32(roll.itemid); // The itemEntryId for the item that shall be rolled for
|
||||
data << uint32(roll.itemRandomPropId); // Item random property ID
|
||||
@@ -923,7 +923,7 @@ void Group::SendLooter(Creature* creature, Player* groupLooter)
|
||||
ASSERT(creature);
|
||||
|
||||
WorldPacket data(SMSG_LOOT_LIST, (8+8));
|
||||
data << uint64(creature->GetGUID());
|
||||
data << creature->GetGUID();
|
||||
|
||||
if (GetLootMethod() == MASTER_LOOT && creature->loot.hasOverThresholdItem())
|
||||
data << GetMasterLooterGuid().WriteAsPacked();
|
||||
@@ -1267,7 +1267,7 @@ void Group::MasterLoot(Loot* loot, WorldObject* pLootedObject)
|
||||
|
||||
if (looter->IsWithinDistInMap(pLootedObject, sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE), false))
|
||||
{
|
||||
data << uint64(looter->GetGUID());
|
||||
data << looter->GetGUID();
|
||||
++real_count;
|
||||
}
|
||||
}
|
||||
@@ -1505,9 +1505,9 @@ void Group::SetTargetIcon(uint8 id, ObjectGuid whoGuid, ObjectGuid targetGuid)
|
||||
|
||||
WorldPacket data(MSG_RAID_TARGET_UPDATE, (1+8+1+8));
|
||||
data << uint8(0); // set targets
|
||||
data << uint64(whoGuid);
|
||||
data << whoGuid;
|
||||
data << uint8(id);
|
||||
data << uint64(targetGuid);
|
||||
data << targetGuid;
|
||||
BroadcastPacket(&data, true);
|
||||
}
|
||||
|
||||
@@ -1525,7 +1525,7 @@ void Group::SendTargetIconList(WorldSession* session)
|
||||
continue;
|
||||
|
||||
data << uint8(i);
|
||||
data << uint64(m_targetIcons[i]);
|
||||
data << m_targetIcons[i];
|
||||
}
|
||||
|
||||
session->SendPacket(&data);
|
||||
@@ -1567,7 +1567,7 @@ void Group::SendUpdateToPlayer(ObjectGuid playerGUID, MemberSlot* slot)
|
||||
data << uint8(0); // 4.x new
|
||||
}
|
||||
|
||||
data << uint64(m_guid);
|
||||
data << m_guid;
|
||||
data << uint32(m_counter++); // 3.3, value increases every time this packet gets sent
|
||||
data << uint32(GetMembersCount()-1);
|
||||
for (member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr)
|
||||
@@ -1581,21 +1581,21 @@ void Group::SendUpdateToPlayer(ObjectGuid playerGUID, MemberSlot* slot)
|
||||
onlineState = onlineState | ((isBGGroup() || isBFGroup()) ? MEMBER_STATUS_PVP : 0);
|
||||
|
||||
data << citr->name;
|
||||
data << uint64(citr->guid); // guid
|
||||
data << citr->guid; // guid
|
||||
data << uint8(onlineState); // online-state
|
||||
data << uint8(citr->group); // groupid
|
||||
data << uint8(citr->flags); // See enum GroupMemberFlags
|
||||
data << uint8(citr->roles); // Lfg Roles
|
||||
}
|
||||
|
||||
data << uint64(m_leaderGuid); // leader guid
|
||||
data << m_leaderGuid; // leader guid
|
||||
|
||||
if (GetMembersCount() - 1)
|
||||
{
|
||||
data << uint8(m_lootMethod); // loot method
|
||||
|
||||
if (m_lootMethod == MASTER_LOOT)
|
||||
data << uint64(m_masterLooterGuid); // master looter guid
|
||||
data << m_masterLooterGuid; // master looter guid
|
||||
else
|
||||
data << uint64(0);
|
||||
|
||||
@@ -1671,7 +1671,7 @@ void Group::OfflineReadyCheck()
|
||||
if (!player || !player->GetSession())
|
||||
{
|
||||
WorldPacket data(MSG_RAID_READY_CHECK_CONFIRM, 9);
|
||||
data << uint64(citr->guid);
|
||||
data << citr->guid;
|
||||
data << uint8(0);
|
||||
BroadcastReadyCheck(&data);
|
||||
}
|
||||
|
||||
@@ -2766,7 +2766,7 @@ bool Guild::AddMember(ObjectGuid guid, uint8 rankId)
|
||||
_UpdateAccountsNumber();
|
||||
_LogEvent(GUILD_EVENT_LOG_JOIN_GUILD, lowguid);
|
||||
_BroadcastEvent(GE_JOINED, guid, name.c_str());
|
||||
sGuildFinderMgr->RemoveAllMembershipRequestsFromPlayer(lowguid);
|
||||
sGuildFinderMgr->RemoveAllMembershipRequestsFromPlayer(guid);
|
||||
|
||||
// Call scripts if member was succesfully added (and stored to database)
|
||||
sScriptMgr->OnGuildAddMember(this, player, rankId);
|
||||
@@ -3391,7 +3391,7 @@ void Guild::_BroadcastEvent(GuildEvents guildEvent, ObjectGuid guid, const char*
|
||||
{
|
||||
uint8 count = !param3 ? (!param2 ? (!param1 ? 0 : 1) : 2) : 3;
|
||||
|
||||
WorldPacket data(SMSG_GUILD_EVENT, 1 + 1 + count + (guid ? 8 : 0));
|
||||
WorldPacket data(SMSG_GUILD_EVENT, 1 + 1 + count + 8);
|
||||
data << uint8(guildEvent);
|
||||
data << uint8(count);
|
||||
|
||||
|
||||
@@ -137,7 +137,7 @@ void GuildFinderMgr::AddMembershipRequest(uint32 guildGuid, MembershipRequest co
|
||||
SendApplicantListUpdate(*guild);
|
||||
}
|
||||
|
||||
void GuildFinderMgr::RemoveAllMembershipRequestsFromPlayer(uint32 playerId)
|
||||
void GuildFinderMgr::RemoveAllMembershipRequestsFromPlayer(ObjectGuid playerId)
|
||||
{
|
||||
for (MembershipRequestStore::iterator itr = _membershipRequests.begin(); itr != _membershipRequests.end(); ++itr)
|
||||
{
|
||||
|
||||
@@ -226,7 +226,7 @@ class GuildFinderMgr
|
||||
* @brief Removes all membership request from a player.
|
||||
* @param playerId The player's database guid whose application shall be deleted.
|
||||
*/
|
||||
void RemoveAllMembershipRequestsFromPlayer(uint32 playerId);
|
||||
void RemoveAllMembershipRequestsFromPlayer(ObjectGuid playerId);
|
||||
|
||||
/**
|
||||
* @brief Removes a membership request to a guild.
|
||||
|
||||
@@ -64,7 +64,7 @@ void WorldSession::SendAuctionHello(ObjectGuid guid, Creature* unit)
|
||||
return;
|
||||
|
||||
WorldPacket data(MSG_AUCTION_HELLO, 12);
|
||||
data << uint64(guid);
|
||||
data << guid;
|
||||
data << uint32(ahEntry->houseId);
|
||||
data << uint8(1); // 3.3.3: 1 - AH enabled, 0 - AH disabled
|
||||
SendPacket(&data);
|
||||
@@ -103,7 +103,7 @@ void WorldSession::SendAuctionBidderNotification(uint32 location, uint32 auction
|
||||
WorldPacket data(SMSG_AUCTION_BIDDER_NOTIFICATION, (8*4));
|
||||
data << uint32(location);
|
||||
data << uint32(auctionId);
|
||||
data << uint64(bidder);
|
||||
data << bidder;
|
||||
data << uint64(bidSum);
|
||||
data << uint64(diff);
|
||||
data << uint32(itemEntry);
|
||||
|
||||
@@ -301,7 +301,7 @@ void WorldSession::HandleBfEntryInviteResponse(WorldPacket& recvData)
|
||||
recvData.ReadByteSeq(guid[7]);
|
||||
recvData.ReadByteSeq(guid[5]);
|
||||
|
||||
TC_LOG_ERROR("misc", "HandleBattlefieldInviteResponse: GUID: " UI64FMTD ", accepted: %u", uint64(guid), accepted);
|
||||
TC_LOG_ERROR("misc", "HandleBattlefieldInviteResponse: GUID: %s, accepted: %u", guid.ToString().c_str(), accepted);
|
||||
|
||||
Battlefield* bf = sBattlefieldMgr->GetBattlefieldByGUID(guid);
|
||||
if (!bf)
|
||||
@@ -346,7 +346,7 @@ void WorldSession::HandleBfExitRequest(WorldPacket& recvData)
|
||||
recvData.ReadByteSeq(guid[7]);
|
||||
recvData.ReadByteSeq(guid[6]);
|
||||
|
||||
TC_LOG_ERROR("misc", "HandleBfExitRequest: GUID: " UI64FMTD, uint64(guid));
|
||||
TC_LOG_ERROR("misc", "HandleBfExitRequest: GUID: %s", guid.ToString().c_str());
|
||||
|
||||
Battlefield* bf = sBattlefieldMgr->GetBattlefieldByGUID(guid);
|
||||
if (!bf)
|
||||
|
||||
@@ -92,9 +92,9 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recvData*/)
|
||||
data << int32(calendarEvent->GetDungeonId());
|
||||
|
||||
Guild* guild = sGuildMgr->GetGuildById(calendarEvent->GetGuildId());
|
||||
data << uint64(guild ? guild->GetGUID() : 0);
|
||||
data << (guild ? guild->GetGUID() : ObjectGuid::Empty);
|
||||
|
||||
data.appendPackGUID(calendarEvent->GetCreatorGUID());
|
||||
data << calendarEvent->GetCreatorGUID().WriteAsPacked();
|
||||
}
|
||||
|
||||
data << uint32(currTime); // server time
|
||||
|
||||
@@ -1568,7 +1568,7 @@ void WorldSession::HandleEquipmentSetSave(WorldPacket& recvData)
|
||||
|
||||
Item* item = _player->GetItemByPos(INVENTORY_SLOT_BAG_0, i);
|
||||
|
||||
if (!item && itemGuid) // cheating check 1
|
||||
if (!item && !itemGuid.IsEmpty()) // cheating check 1
|
||||
return;
|
||||
|
||||
if (item && item->GetGUID() != itemGuid) // cheating check 2
|
||||
|
||||
@@ -1078,8 +1078,8 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recvData)
|
||||
recvData >> gem_guids[i];
|
||||
|
||||
//cheat -> tried to socket same gem multiple times
|
||||
if ((gem_guids[0] && (gem_guids[0] == gem_guids[1] || gem_guids[0] == gem_guids[2])) ||
|
||||
(gem_guids[1] && (gem_guids[1] == gem_guids[2])))
|
||||
if ((!gem_guids[0].IsEmpty() && (gem_guids[0] == gem_guids[1] || gem_guids[0] == gem_guids[2])) ||
|
||||
(!gem_guids[1].IsEmpty() && (gem_guids[1] == gem_guids[2])))
|
||||
return;
|
||||
|
||||
Item* itemTarget = _player->GetItemByGuid(item_guid);
|
||||
@@ -1095,7 +1095,7 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recvData)
|
||||
|
||||
Item* Gems[MAX_GEM_SOCKETS];
|
||||
for (int i = 0; i < MAX_GEM_SOCKETS; ++i)
|
||||
Gems[i] = gem_guids[i] ? _player->GetItemByGuid(gem_guids[i]) : NULL;
|
||||
Gems[i] = !gem_guids[i].IsEmpty() ? _player->GetItemByGuid(gem_guids[i]) : NULL;
|
||||
|
||||
GemPropertiesEntry const* GemProps[MAX_GEM_SOCKETS];
|
||||
for (int i = 0; i < MAX_GEM_SOCKETS; ++i) //get geminfo from dbc storage
|
||||
|
||||
@@ -43,7 +43,7 @@ void BuildPartyLockDungeonBlock(WorldPacket& data, lfg::LfgLockPartyMap const& l
|
||||
data << uint8(lockMap.size());
|
||||
for (lfg::LfgLockPartyMap::const_iterator it = lockMap.begin(); it != lockMap.end(); ++it)
|
||||
{
|
||||
data << uint64(it->first); // Player guid
|
||||
data << it->first; // Player guid
|
||||
BuildPlayerLockDungeonBlock(data, it->second);
|
||||
}
|
||||
}
|
||||
@@ -719,7 +719,7 @@ void WorldSession::SendLfgBootProposalUpdate(lfg::LfgPlayerBoot const& boot)
|
||||
data << uint8(agreeNum >= lfg::LFG_GROUP_KICK_VOTES_NEEDED); // Did succeed
|
||||
data << uint8(playerVote != lfg::LFG_ANSWER_PENDING); // Did Vote
|
||||
data << uint8(playerVote == lfg::LFG_ANSWER_AGREE); // Agree
|
||||
data << uint64(boot.victim); // Victim GUID
|
||||
data << boot.victim; // Victim GUID
|
||||
data << uint32(votesNum); // Total Votes
|
||||
data << uint32(agreeNum); // Agree Count
|
||||
data << uint32(secsleft); // Time Left
|
||||
|
||||
@@ -871,7 +871,7 @@ void WorldSession::HandleQueryNextMailTime(WorldPacket& /*recvData*/)
|
||||
if (sentSenders.count(m->sender))
|
||||
continue;
|
||||
|
||||
data << uint64(m->messageType == MAIL_NORMAL ? ObjectGuid(HIGHGUID_PLAYER, m->sender) : ObjectGuid::Empty); // player guid
|
||||
data << (m->messageType == MAIL_NORMAL ? ObjectGuid(HIGHGUID_PLAYER, m->sender) : ObjectGuid::Empty); // player guid
|
||||
data << uint32(m->messageType != MAIL_NORMAL ? m->sender : 0); // non-player entries
|
||||
data << uint32(m->messageType);
|
||||
data << uint32(m->stationery);
|
||||
|
||||
@@ -1055,7 +1055,7 @@ void WorldSession::HandleRequestAccountData(WorldPacket& recvData)
|
||||
dest.resize(destSize);
|
||||
|
||||
WorldPacket data(SMSG_UPDATE_ACCOUNT_DATA, 8+4+4+4+destSize);
|
||||
data << uint64(_player ? _player->GetGUID() : ObjectGuid::Empty);
|
||||
data << (_player ? _player->GetGUID() : ObjectGuid::Empty);
|
||||
data << uint32(type); // type (0-7)
|
||||
data << uint32(adata->Time); // unix time
|
||||
data << uint32(size); // decompressed length
|
||||
|
||||
@@ -303,10 +303,10 @@ void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket& recvData)
|
||||
SendPacket(&data);
|
||||
}
|
||||
|
||||
void WorldSession::SendTrainerBuyFailed(uint64 guid, uint32 spellId, uint32 reason)
|
||||
void WorldSession::SendTrainerBuyFailed(ObjectGuid guid, uint32 spellId, uint32 reason)
|
||||
{
|
||||
WorldPacket data(SMSG_TRAINER_BUY_FAILED, 16);
|
||||
data << uint64(guid);
|
||||
data << guid;
|
||||
data << uint32(spellId); // should be same as in packet from client
|
||||
data << uint32(reason); // 1 == "Not enough money for trainer service." 0 == "Trainer service %d unavailable."
|
||||
SendPacket(&data);
|
||||
|
||||
@@ -125,7 +125,7 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket& recvData)
|
||||
|
||||
if (Player* playerQuestObject = object->ToPlayer())
|
||||
{
|
||||
if ((_player->GetDivider() && _player->GetDivider() != guid) ||
|
||||
if ((!_player->GetDivider().IsEmpty() && _player->GetDivider() != guid) ||
|
||||
((object != _player && !playerQuestObject->CanShareQuest(questId))))
|
||||
{
|
||||
CLOSE_GOSSIP_CLEAR_DIVIDER();
|
||||
@@ -625,7 +625,7 @@ void WorldSession::HandleQuestPushResult(WorldPacket& recvPacket)
|
||||
|
||||
TC_LOG_DEBUG("network", "WORLD: Received MSG_QUEST_PUSH_RESULT");
|
||||
|
||||
if (_player->GetDivider() && _player->GetDivider() == guid)
|
||||
if (!_player->GetDivider().IsEmpty() && _player->GetDivider() == guid)
|
||||
{
|
||||
Player* player = ObjectAccessor::FindPlayer(_player->GetDivider());
|
||||
if (player)
|
||||
|
||||
@@ -571,7 +571,7 @@ void WorldSession::HandleTotemDestroyed(WorldPacket& recvPacket)
|
||||
return;
|
||||
|
||||
uint8 slotId;
|
||||
uint64 guid;
|
||||
ObjectGuid guid;
|
||||
recvPacket >> slotId;
|
||||
recvPacket >> guid;
|
||||
|
||||
@@ -662,7 +662,7 @@ void WorldSession::HandleMirrorImageDataRequest(WorldPacket& recvData)
|
||||
data << uint8(player->GetByteValue(PLAYER_BYTES, 2)); // hair
|
||||
data << uint8(player->GetByteValue(PLAYER_BYTES, 3)); // haircolor
|
||||
data << uint8(player->GetByteValue(PLAYER_BYTES_2, 0)); // facialhair
|
||||
data << uint64(guild ? guild->GetGUID() : 0);
|
||||
data << (guild ? guild->GetGUID() : ObjectGuid::Empty);
|
||||
|
||||
static EquipmentSlots const itemSlots[] =
|
||||
{
|
||||
|
||||
@@ -208,7 +208,7 @@ void MotionMaster::MoveTargetedHome()
|
||||
TC_LOG_DEBUG("misc", "Creature (Entry: %u GUID: %u) targeted home", _owner->GetEntry(), _owner->GetGUIDLow());
|
||||
Mutate(new HomeMovementGenerator<Creature>(), MOTION_SLOT_ACTIVE);
|
||||
}
|
||||
else if (_owner->GetTypeId() == TYPEID_UNIT && _owner->ToCreature()->GetCharmerOrOwnerGUID())
|
||||
else if (_owner->GetTypeId() == TYPEID_UNIT && !_owner->ToCreature()->GetCharmerOrOwnerGUID().IsEmpty())
|
||||
{
|
||||
TC_LOG_DEBUG("misc", "Pet or controlled creature (Entry: %u GUID: %u) targeting home", _owner->GetEntry(), _owner->GetGUIDLow());
|
||||
Unit* target = _owner->ToCreature()->GetCharmerOrOwner();
|
||||
|
||||
@@ -60,7 +60,7 @@ namespace Movement
|
||||
{
|
||||
MoveSpline& move_spline = *unit->movespline;
|
||||
|
||||
bool transport = unit->GetTransGUID() != 0;
|
||||
bool transport = !unit->GetTransGUID().IsEmpty();
|
||||
Location real_position;
|
||||
// there is a big chance that current position is unknown if current state is not finalized, need compute it
|
||||
// this also allows calculate spline position and update map position in much greater intervals
|
||||
@@ -88,7 +88,7 @@ namespace Movement
|
||||
// correct first vertex
|
||||
args.path[0] = real_position;
|
||||
args.initialOrientation = real_position.orientation;
|
||||
move_spline.onTransport = (unit->GetTransGUID() != 0);
|
||||
move_spline.onTransport = !unit->GetTransGUID().IsEmpty();
|
||||
|
||||
uint32 moveFlags = unit->m_movementInfo.GetMovementFlags();
|
||||
moveFlags |= MOVEMENTFLAG_FORWARD;
|
||||
@@ -138,7 +138,7 @@ namespace Movement
|
||||
if (move_spline.Finalized())
|
||||
return;
|
||||
|
||||
bool transport = unit->GetTransGUID() != 0;
|
||||
bool transport = !unit->GetTransGUID().IsEmpty();
|
||||
Location loc;
|
||||
if (move_spline.onTransport == transport)
|
||||
loc = move_spline.ComputePosition();
|
||||
@@ -178,7 +178,7 @@ namespace Movement
|
||||
{
|
||||
args.splineId = splineIdGen.NewId();
|
||||
// Elevators also use MOVEMENTFLAG_ONTRANSPORT but we do not keep track of their position changes
|
||||
args.TransformForTransport = unit->GetTransGUID() != 0;
|
||||
args.TransformForTransport = !unit->GetTransGUID().IsEmpty();
|
||||
// mix existing state into new
|
||||
args.flags.walkmode = unit->m_movementInfo.HasMovementFlag(MOVEMENTFLAG_WALKING);
|
||||
args.flags.flying = unit->m_movementInfo.HasMovementFlag(MovementFlags(MOVEMENTFLAG_CAN_FLY | MOVEMENTFLAG_DISABLE_GRAVITY));
|
||||
|
||||
@@ -682,7 +682,7 @@ class WorldSession
|
||||
void HandleStableRevivePet(WorldPacket& recvPacket);
|
||||
void HandleStableSwapPet(WorldPacket& recvPacket);
|
||||
void HandleStableSwapPetCallback(PreparedQueryResult result, uint32 petId);
|
||||
void SendTrainerBuyFailed(uint64 guid, uint32 spellId, uint32 reason);
|
||||
void SendTrainerBuyFailed(ObjectGuid guid, uint32 spellId, uint32 reason);
|
||||
|
||||
void HandleDuelAcceptedOpcode(WorldPacket& recvPacket);
|
||||
void HandleDuelCancelledOpcode(WorldPacket& recvPacket);
|
||||
|
||||
@@ -4609,7 +4609,7 @@ void AuraEffect::HandleAuraRetainComboPoints(AuraApplication const* aurApp, uint
|
||||
|
||||
// combo points was added in SPELL_EFFECT_ADD_COMBO_POINTS handler
|
||||
// remove only if aura expire by time (in case combo points amount change aura removed without combo points lost)
|
||||
if (!(apply) && GetBase()->GetDuration() == 0 && target->ToPlayer()->GetComboTarget())
|
||||
if (!(apply) && GetBase()->GetDuration() == 0 && !target->ToPlayer()->GetComboTarget().IsEmpty())
|
||||
if (Unit* unit = ObjectAccessor::GetUnit(*target, target->ToPlayer()->GetComboTarget()))
|
||||
target->ToPlayer()->AddComboPoints(unit, -GetAmount());
|
||||
}
|
||||
|
||||
@@ -261,7 +261,7 @@ Aura* Aura::TryRefreshStackOrCreate(SpellInfo const* spellproto, uint8 tryEffMas
|
||||
{
|
||||
ASSERT(spellproto);
|
||||
ASSERT(owner);
|
||||
ASSERT(caster || casterGUID);
|
||||
ASSERT(caster || !casterGUID.IsEmpty());
|
||||
ASSERT(tryEffMask <= MAX_EFFECT_MASK);
|
||||
if (refresh)
|
||||
*refresh = false;
|
||||
@@ -287,7 +287,7 @@ Aura* Aura::TryCreate(SpellInfo const* spellproto, uint8 tryEffMask, WorldObject
|
||||
{
|
||||
ASSERT(spellproto);
|
||||
ASSERT(owner);
|
||||
ASSERT(caster || casterGUID);
|
||||
ASSERT(caster || !casterGUID.IsEmpty());
|
||||
ASSERT(tryEffMask <= MAX_EFFECT_MASK);
|
||||
uint8 effMask = Aura::BuildEffectMaskForOwner(spellproto, tryEffMask, owner);
|
||||
if (!effMask)
|
||||
@@ -300,7 +300,7 @@ Aura* Aura::Create(SpellInfo const* spellproto, uint8 effMask, WorldObject* owne
|
||||
ASSERT(effMask);
|
||||
ASSERT(spellproto);
|
||||
ASSERT(owner);
|
||||
ASSERT(caster || casterGUID);
|
||||
ASSERT(caster || !casterGUID.IsEmpty());
|
||||
ASSERT(effMask <= MAX_EFFECT_MASK);
|
||||
// try to get caster of aura
|
||||
if (casterGUID)
|
||||
@@ -341,7 +341,7 @@ Aura* Aura::Create(SpellInfo const* spellproto, uint8 effMask, WorldObject* owne
|
||||
}
|
||||
|
||||
Aura::Aura(SpellInfo const* spellproto, WorldObject* owner, Unit* caster, Item* castItem, ObjectGuid casterGUID) :
|
||||
m_spellInfo(spellproto), m_casterGuid(casterGUID ? casterGUID : caster->GetGUID()),
|
||||
m_spellInfo(spellproto), m_casterGuid(!casterGUID.IsEmpty() ? casterGUID : caster->GetGUID()),
|
||||
m_castItemGuid(castItem ? castItem->GetGUID() : ObjectGuid::Empty), m_applyTime(time(NULL)),
|
||||
m_owner(owner), m_timeCla(0), m_updateTargetMapInterval(0),
|
||||
m_casterLevel(caster ? caster->getLevel() : m_spellInfo->SpellLevel), m_procCharges(0), m_stackAmount(1),
|
||||
@@ -426,7 +426,7 @@ void Aura::_ApplyForTarget(Unit* target, Unit* caster, AuraApplication * auraApp
|
||||
{
|
||||
if (m_spellInfo->IsCooldownStartedOnEvent())
|
||||
{
|
||||
Item* castItem = m_castItemGuid ? caster->ToPlayer()->GetItemByGuid(m_castItemGuid) : NULL;
|
||||
Item* castItem = !m_castItemGuid.IsEmpty() ? caster->ToPlayer()->GetItemByGuid(m_castItemGuid) : NULL;
|
||||
caster->ToPlayer()->AddSpellAndCategoryCooldowns(m_spellInfo, castItem ? castItem->GetEntry() : 0, NULL, true);
|
||||
}
|
||||
}
|
||||
@@ -1704,7 +1704,7 @@ bool Aura::CanStackWith(Aura const* existingAura) const
|
||||
// don't allow passive area auras to stack
|
||||
if (m_spellInfo->IsMultiSlotAura() && !IsArea())
|
||||
return true;
|
||||
if (GetCastItemGUID() && existingAura->GetCastItemGUID())
|
||||
if (!GetCastItemGUID().IsEmpty() && existingAura->GetCastItemGUID())
|
||||
if (GetCastItemGUID() != existingAura->GetCastItemGUID() && (m_spellInfo->AttributesCu & SPELL_ATTR0_CU_ENCHANT_PROC))
|
||||
return true;
|
||||
// same spell with same caster should not stack
|
||||
|
||||
@@ -444,7 +444,7 @@ void SpellCastTargets::RemoveDst()
|
||||
|
||||
void SpellCastTargets::Update(Unit* caster)
|
||||
{
|
||||
m_objectTarget = m_objectTargetGUID ? ((m_objectTargetGUID == caster->GetGUID()) ? caster : ObjectAccessor::GetWorldObject(*caster, m_objectTargetGUID)) : NULL;
|
||||
m_objectTarget = !m_objectTargetGUID.IsEmpty() ? ((m_objectTargetGUID == caster->GetGUID()) ? caster : ObjectAccessor::GetWorldObject(*caster, m_objectTargetGUID)) : NULL;
|
||||
|
||||
m_itemTarget = NULL;
|
||||
if (caster->GetTypeId() == TYPEID_PLAYER)
|
||||
@@ -462,7 +462,7 @@ void SpellCastTargets::Update(Unit* caster)
|
||||
}
|
||||
|
||||
// update positions by transport move
|
||||
if (HasSrc() && m_src._transportGUID)
|
||||
if (HasSrc() && !m_src._transportGUID.IsEmpty())
|
||||
{
|
||||
if (WorldObject* transport = ObjectAccessor::GetWorldObject(*caster, m_src._transportGUID))
|
||||
{
|
||||
@@ -471,7 +471,7 @@ void SpellCastTargets::Update(Unit* caster)
|
||||
}
|
||||
}
|
||||
|
||||
if (HasDst() && m_dst._transportGUID)
|
||||
if (HasDst() && !m_dst._transportGUID.IsEmpty())
|
||||
{
|
||||
if (WorldObject* transport = ObjectAccessor::GetWorldObject(*caster, m_dst._transportGUID))
|
||||
{
|
||||
@@ -1648,7 +1648,7 @@ void Spell::SelectEffectTypeImplicitTargets(uint8 effIndex)
|
||||
{
|
||||
case SPELL_EFFECT_SUMMON_RAF_FRIEND:
|
||||
case SPELL_EFFECT_SUMMON_PLAYER:
|
||||
if (m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->GetTarget())
|
||||
if (m_caster->GetTypeId() == TYPEID_PLAYER && !m_caster->GetTarget().IsEmpty())
|
||||
{
|
||||
WorldObject* target = ObjectAccessor::FindPlayer(m_caster->GetTarget());
|
||||
|
||||
@@ -3054,7 +3054,7 @@ void Spell::cast(bool skipCheck)
|
||||
}
|
||||
|
||||
// cancel at lost explicit target during cast
|
||||
if (m_targets.GetObjectTargetGUID() && !m_targets.GetObjectTarget())
|
||||
if (!m_targets.GetObjectTargetGUID().IsEmpty() && !m_targets.GetObjectTarget())
|
||||
{
|
||||
cancel();
|
||||
return;
|
||||
@@ -3481,7 +3481,7 @@ void Spell::update(uint32 difftime)
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_targets.GetUnitTargetGUID() && !m_targets.GetUnitTarget())
|
||||
if (!m_targets.GetUnitTargetGUID().IsEmpty() && !m_targets.GetUnitTarget())
|
||||
{
|
||||
TC_LOG_DEBUG("spells", "Spell %u is cancelled due to removal of target.", m_spellInfo->Id);
|
||||
cancel();
|
||||
@@ -4005,7 +4005,7 @@ void Spell::WriteSpellGoTargets(WorldPacket* data)
|
||||
{
|
||||
if ((*ihit).missCondition == SPELL_MISS_NONE) // Add only hits
|
||||
{
|
||||
*data << uint64(ihit->targetGUID);
|
||||
*data << (ihit->targetGUID);
|
||||
m_channelTargetEffectMask |=ihit->effectMask;
|
||||
++hit;
|
||||
}
|
||||
@@ -4013,7 +4013,7 @@ void Spell::WriteSpellGoTargets(WorldPacket* data)
|
||||
|
||||
for (std::list<GOTargetInfo>::const_iterator ighit = m_UniqueGOTargetInfo.begin(); ighit != m_UniqueGOTargetInfo.end() && hit < 255; ++ighit)
|
||||
{
|
||||
*data << uint64(ighit->targetGUID); // Always hits
|
||||
*data << (ighit->targetGUID); // Always hits
|
||||
++hit;
|
||||
}
|
||||
|
||||
@@ -4024,7 +4024,7 @@ void Spell::WriteSpellGoTargets(WorldPacket* data)
|
||||
{
|
||||
if (ihit->missCondition != SPELL_MISS_NONE) // Add only miss
|
||||
{
|
||||
*data << uint64(ihit->targetGUID);
|
||||
*data << (ihit->targetGUID);
|
||||
*data << uint8(ihit->missCondition);
|
||||
if (ihit->missCondition == SPELL_MISS_REFLECT)
|
||||
*data << uint8(ihit->reflectResult);
|
||||
@@ -4654,7 +4654,7 @@ void Spell::HandleHolyPower(Player* caster)
|
||||
if (!m_powerCost || !modOwner)
|
||||
return;
|
||||
|
||||
if (uint64 targetGUID = m_targets.GetUnitTargetGUID())
|
||||
if (ObjectGuid targetGUID = m_targets.GetUnitTargetGUID())
|
||||
{
|
||||
for (std::list<TargetInfo>::iterator ihit = m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end(); ++ihit)
|
||||
{
|
||||
@@ -6426,7 +6426,7 @@ bool Spell::UpdatePointers()
|
||||
m_originalCaster = NULL;
|
||||
}
|
||||
|
||||
if (m_castItemGUID && m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||
if (!m_castItemGUID.IsEmpty() && m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
m_CastItem = m_caster->ToPlayer()->GetItemByGuid(m_castItemGUID);
|
||||
// cast item not found, somehow the item is no longer where we expected
|
||||
|
||||
@@ -1219,7 +1219,7 @@ void Spell::EffectHeal(SpellEffIndex /*effIndex*/)
|
||||
if (unitTarget && unitTarget->IsAlive() && damage >= 0)
|
||||
{
|
||||
// Try to get original caster
|
||||
Unit* caster = m_originalCasterGUID ? m_originalCaster : m_caster;
|
||||
Unit* caster = !m_originalCasterGUID.IsEmpty() ? m_originalCaster : m_caster;
|
||||
|
||||
// Skip if m_originalCaster not available
|
||||
if (!caster)
|
||||
@@ -5286,7 +5286,7 @@ void Spell::EffectCreateTamedPet(SpellEffIndex effIndex)
|
||||
if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET)
|
||||
return;
|
||||
|
||||
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER || unitTarget->GetPetGUID() || unitTarget->getClass() != CLASS_HUNTER)
|
||||
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER || !unitTarget->GetPetGUID().IsEmpty() || unitTarget->getClass() != CLASS_HUNTER)
|
||||
return;
|
||||
|
||||
uint32 creatureEntry = m_spellInfo->Effects[effIndex].MiscValue;
|
||||
|
||||
@@ -331,7 +331,7 @@ void CreatureTextMgr::SendSound(Creature* source, uint32 sound, ChatMsg msgType,
|
||||
|
||||
WorldPacket data(SMSG_PLAY_SOUND, 4 + 8);
|
||||
data << uint32(sound);
|
||||
data << uint64(source->GetGUID());
|
||||
data << source->GetGUID();
|
||||
SendNonChatPacket(source, &data, msgType, whisperTarget, range, team, gmOnly);
|
||||
}
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ public:
|
||||
{
|
||||
std::string name;
|
||||
// save queries if ticket is not assigned
|
||||
if (_assignedTo)
|
||||
if (!_assignedTo.IsEmpty())
|
||||
sObjectMgr->GetPlayerNameByGUID(_assignedTo, name);
|
||||
|
||||
return name;
|
||||
|
||||
@@ -211,7 +211,7 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
if (sObjectMgr->GetPlayerGUIDByName(delInfo.name))
|
||||
if (!sObjectMgr->GetPlayerGUIDByName(delInfo.name).IsEmpty())
|
||||
{
|
||||
handler->PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_NAME, delInfo.name.c_str(), delInfo.guid.GetCounter(), delInfo.accountId);
|
||||
return;
|
||||
@@ -990,7 +990,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (PlayerDumpWriter().WriteDump(fileStr, uint32(guid)))
|
||||
switch (PlayerDumpWriter().WriteDump(fileStr, uint32(guid.GetCounter())))
|
||||
{
|
||||
case DUMP_SUCCESS:
|
||||
handler->PSendSysMessage(LANG_COMMAND_EXPORT_SUCCESS);
|
||||
|
||||
@@ -182,7 +182,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
if (handler->GetSession()->GetPlayer()->GetTarget())
|
||||
if (!handler->GetSession()->GetPlayer()->GetTarget().IsEmpty())
|
||||
unit->PlayDistanceSound(soundId, handler->GetSession()->GetPlayer());
|
||||
else
|
||||
unit->PlayDirectSound(soundId, handler->GetSession()->GetPlayer());
|
||||
@@ -390,15 +390,15 @@ public:
|
||||
ifs.close();
|
||||
return false;
|
||||
}
|
||||
data << uint64(obj->GetGUID());
|
||||
data << obj->GetGUID();
|
||||
}
|
||||
else if (type == "myguid")
|
||||
{
|
||||
data << uint64(player->GetGUID());
|
||||
data << player->GetGUID();
|
||||
}
|
||||
else if (type == "itsguid")
|
||||
{
|
||||
data << uint64(unit->GetGUID());
|
||||
data << unit->GetGUID();
|
||||
}
|
||||
else if (type == "itspos")
|
||||
{
|
||||
|
||||
@@ -371,7 +371,7 @@ public:
|
||||
}
|
||||
|
||||
ObjectGuid ownerGuid = object->GetOwnerGUID();
|
||||
if (ownerGuid)
|
||||
if (!ownerGuid.IsEmpty())
|
||||
{
|
||||
Unit* owner = ObjectAccessor::GetUnit(*handler->GetSession()->GetPlayer(), ownerGuid);
|
||||
if (!owner || !ownerGuid.IsPlayer())
|
||||
|
||||
@@ -138,7 +138,7 @@ public:
|
||||
if (*args)
|
||||
{
|
||||
ObjectGuid guid = handler->extractGuidFromLink((char*)args);
|
||||
if (guid)
|
||||
if (!guid.IsEmpty())
|
||||
object = (WorldObject*)ObjectAccessor::GetObjectByTypeMask(*handler->GetSession()->GetPlayer(), guid, TYPEMASK_UNIT | TYPEMASK_GAMEOBJECT);
|
||||
|
||||
if (!object)
|
||||
@@ -709,7 +709,7 @@ public:
|
||||
if (*args)
|
||||
{
|
||||
ObjectGuid guid = handler->extractGuidFromLink((char*)args);
|
||||
if (guid)
|
||||
if (!guid.IsEmpty())
|
||||
obj = (WorldObject*)ObjectAccessor::GetObjectByTypeMask(*handler->GetSession()->GetPlayer(), guid, TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT);
|
||||
|
||||
if (!obj)
|
||||
@@ -1766,7 +1766,7 @@ public:
|
||||
Player* player = handler->GetSession()->GetPlayer();
|
||||
|
||||
// accept only explicitly selected target (not implicitly self targeting case)
|
||||
Creature* target = player->GetTarget() ? handler->getSelectedCreature() : nullptr;
|
||||
Creature* target = !player->GetTarget().IsEmpty() ? handler->getSelectedCreature() : nullptr;
|
||||
if (target)
|
||||
{
|
||||
if (target->IsPet())
|
||||
@@ -2519,7 +2519,7 @@ public:
|
||||
|
||||
WorldPacket data(SMSG_PLAY_SOUND, 4 + 8);
|
||||
data << uint32(soundId);
|
||||
data << uint64(handler->GetSession()->GetPlayer()->GetGUID());
|
||||
data << handler->GetSession()->GetPlayer()->GetGUID();
|
||||
sWorld->SendGlobalMessage(&data);
|
||||
|
||||
handler->PSendSysMessage(LANG_COMMAND_PLAYED_TO_ALL, soundId);
|
||||
|
||||
@@ -1396,7 +1396,7 @@ public:
|
||||
|
||||
Player* player = handler->GetSession()->GetPlayer();
|
||||
|
||||
if (player->GetPetGUID())
|
||||
if (!player->GetPetGUID().IsEmpty())
|
||||
{
|
||||
handler->SendSysMessage (LANG_YOU_ALREADY_HAVE_PET);
|
||||
handler->SetSentErrorMessage (true);
|
||||
|
||||
@@ -65,7 +65,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
if (player->GetPetGUID())
|
||||
if (!player->GetPetGUID().IsEmpty())
|
||||
{
|
||||
handler->PSendSysMessage("You already have a pet");
|
||||
handler->SetSentErrorMessage(true);
|
||||
|
||||
@@ -242,7 +242,7 @@ public:
|
||||
target->SendTalentsInfoData(true);
|
||||
return true;
|
||||
}
|
||||
else if (targetGuid)
|
||||
else if (!targetGuid.IsEmpty())
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
|
||||
stmt->setUInt16(0, uint16(AT_LOGIN_NONE | AT_LOGIN_RESET_PET_TALENTS));
|
||||
|
||||
+1
-1
@@ -233,7 +233,7 @@ public:
|
||||
{
|
||||
MobDeath_Timer = 2500;
|
||||
|
||||
if (RingBossGUID)
|
||||
if (!RingBossGUID.IsEmpty())
|
||||
{
|
||||
Creature* boss = ObjectAccessor::GetCreature(*me, RingBossGUID);
|
||||
if (boss && !boss->IsAlive() && boss->isDead())
|
||||
|
||||
+3
-3
@@ -342,7 +342,7 @@ public:
|
||||
|
||||
void TombOfSevenEvent()
|
||||
{
|
||||
if (GhostKillCount < 7 && TombBossGUIDs[TombEventCounter])
|
||||
if (GhostKillCount < 7 && !TombBossGUIDs[TombEventCounter].IsEmpty())
|
||||
{
|
||||
if (Creature* boss = instance->GetCreature(TombBossGUIDs[TombEventCounter]))
|
||||
{
|
||||
@@ -399,7 +399,7 @@ public:
|
||||
}
|
||||
void Update(uint32 diff) override
|
||||
{
|
||||
if (TombEventStarterGUID && GhostKillCount < 7)
|
||||
if (!TombEventStarterGUID.IsEmpty() && GhostKillCount < 7)
|
||||
{
|
||||
if (TombTimer <= diff)
|
||||
{
|
||||
@@ -419,7 +419,7 @@ public:
|
||||
}
|
||||
} else TombTimer -= diff;
|
||||
}
|
||||
if (GhostKillCount >= 7 && TombEventStarterGUID)
|
||||
if (GhostKillCount >= 7 && !TombEventStarterGUID.IsEmpty())
|
||||
TombOfSevenEnd();
|
||||
}
|
||||
};
|
||||
|
||||
+1
-1
@@ -135,7 +135,7 @@ class instance_molten_core : public InstanceMapScript
|
||||
void SummonMajordomoExecutus()
|
||||
{
|
||||
_executusSchedule = false;
|
||||
if (_majordomoExecutusGUID)
|
||||
if (!_majordomoExecutusGUID.IsEmpty())
|
||||
return;
|
||||
|
||||
if (GetBossState(BOSS_MAJORDOMO_EXECUTUS) != DONE)
|
||||
|
||||
@@ -195,8 +195,8 @@ class instance_deadmines : public InstanceMapScript
|
||||
switch (type)
|
||||
{
|
||||
case EVENT_STATE:
|
||||
if (DefiasCannonGUID && IronCladDoorGUID)
|
||||
State=data;
|
||||
if (!DefiasCannonGUID.IsEmpty() && !IronCladDoorGUID.IsEmpty())
|
||||
State = data;
|
||||
break;
|
||||
case EVENT_RHAHKZOR:
|
||||
if (data == DONE)
|
||||
|
||||
@@ -410,7 +410,7 @@ public:
|
||||
if (!PortalGUID[1])
|
||||
DoCastVictim(SPELL_FIENDISH_PORTAL_1, false);
|
||||
|
||||
if (PortalGUID[0] && PortalGUID[1])
|
||||
if (!PortalGUID[0].IsEmpty() && !PortalGUID[1].IsEmpty())
|
||||
{
|
||||
if (Creature* pPortal = ObjectAccessor::GetCreature(*me, PortalGUID[urand(0, 1)]))
|
||||
pPortal->CastSpell(me->GetVictim(), SPELL_SUMMON_FIENDISIMP, false);
|
||||
|
||||
@@ -324,9 +324,12 @@ public:
|
||||
bool OnGossipHello(Player* player, GameObject* go) override
|
||||
{
|
||||
if (Creature* anchor = go->FindNearestCreature(29521, 15))
|
||||
if (ObjectGuid prisonerGUID = anchor->AI()->GetGUID())
|
||||
{
|
||||
ObjectGuid prisonerGUID = anchor->AI()->GetGUID();
|
||||
if (!prisonerGUID.IsEmpty())
|
||||
if (Creature* prisoner = ObjectAccessor::GetCreature(*player, prisonerGUID))
|
||||
ENSURE_AI(npc_unworthy_initiate::npc_unworthy_initiateAI, prisoner->AI())->EventStart(anchor, player);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -708,7 +708,7 @@ public:
|
||||
void MoveInLineOfSight(Unit* who) override
|
||||
|
||||
{
|
||||
if (PlayerGUID || who->GetTypeId() != TYPEID_PLAYER || !who->IsWithinDist(me, INTERACTION_DISTANCE))
|
||||
if (!PlayerGUID.IsEmpty() || who->GetTypeId() != TYPEID_PLAYER || !who->IsWithinDist(me, INTERACTION_DISTANCE))
|
||||
return;
|
||||
|
||||
if (MeetQuestCondition(who->ToPlayer()))
|
||||
@@ -717,7 +717,7 @@ public:
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (PlayerGUID && !me->GetVictim() && me->IsAlive())
|
||||
if (!PlayerGUID.IsEmpty() && !me->GetVictim() && me->IsAlive())
|
||||
{
|
||||
if (ExecuteSpeech_Timer <= diff)
|
||||
{
|
||||
|
||||
@@ -441,7 +441,7 @@ public:
|
||||
{
|
||||
Initialize();
|
||||
DoCast(me, SPELL_HEAD);
|
||||
if (headGUID)
|
||||
if (!headGUID.IsEmpty())
|
||||
{
|
||||
if (Creature* Head = ObjectAccessor::GetCreature((*me), headGUID))
|
||||
Head->DespawnOrUnsummon();
|
||||
|
||||
@@ -625,7 +625,7 @@ public:
|
||||
me->setActive(true);
|
||||
KalecgosGUID = instance->GetGuidData(DATA_KALECGOS_DRAGON);
|
||||
instance->SetBossState(DATA_KALECGOS, NOT_STARTED);
|
||||
if (KalecGUID)
|
||||
if (!KalecGUID.IsEmpty())
|
||||
{
|
||||
if (Creature* Kalec = ObjectAccessor::GetCreature(*me, KalecGUID))
|
||||
Kalec->setDeathState(JUST_DIED);
|
||||
|
||||
@@ -960,7 +960,7 @@ class at_bring_your_orphan_to : public AreaTriggerScript
|
||||
break;
|
||||
}
|
||||
|
||||
if (questId && orphanId && getOrphanGUID(player, orphanId) && player->GetQuestStatus(questId) == QUEST_STATUS_INCOMPLETE)
|
||||
if (questId && orphanId && !getOrphanGUID(player, orphanId).IsEmpty() && player->GetQuestStatus(questId) == QUEST_STATUS_INCOMPLETE)
|
||||
player->AreaExploredOrEventHappens(questId);
|
||||
|
||||
return true;
|
||||
@@ -1021,7 +1021,7 @@ class npc_cw_area_trigger : public CreatureScript
|
||||
orphanId = ORPHAN_BLOOD_ELF;
|
||||
break;
|
||||
case NPC_SILVERMOON_01_CW_TRIGGER:
|
||||
if (player->GetQuestStatus(QUEST_NOW_WHEN_I_GROW_UP) == QUEST_STATUS_INCOMPLETE && getOrphanGUID(player, ORPHAN_BLOOD_ELF))
|
||||
if (player->GetQuestStatus(QUEST_NOW_WHEN_I_GROW_UP) == QUEST_STATUS_INCOMPLETE && !getOrphanGUID(player, ORPHAN_BLOOD_ELF).IsEmpty())
|
||||
{
|
||||
player->AreaExploredOrEventHappens(QUEST_NOW_WHEN_I_GROW_UP);
|
||||
if (player->GetQuestStatus(QUEST_NOW_WHEN_I_GROW_UP) == QUEST_STATUS_COMPLETE)
|
||||
@@ -1051,7 +1051,7 @@ class npc_cw_area_trigger : public CreatureScript
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (questId && orphanId && getOrphanGUID(player, orphanId) && player->GetQuestStatus(questId) == QUEST_STATUS_INCOMPLETE)
|
||||
if (questId && orphanId && !getOrphanGUID(player, orphanId).IsEmpty() && player->GetQuestStatus(questId) == QUEST_STATUS_INCOMPLETE)
|
||||
player->AreaExploredOrEventHappens(questId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -949,7 +949,7 @@ void hyjalAI::WaypointReached(uint32 waypointId)
|
||||
TeleportTimer = 20000;
|
||||
if (me->GetEntry() == JAINA)
|
||||
DoCast(me, SPELL_MASS_TELEPORT, false);
|
||||
if (me->GetEntry() == THRALL && DummyGuid)
|
||||
if (me->GetEntry() == THRALL && !DummyGuid.IsEmpty())
|
||||
{
|
||||
if (Creature* creature = ObjectAccessor::GetCreature(*me, DummyGuid))
|
||||
{
|
||||
|
||||
@@ -774,7 +774,7 @@ public:
|
||||
StomachEnterTimer = 13800;
|
||||
} else StomachEnterTimer -= diff;
|
||||
|
||||
if (StomachEnterVisTimer && StomachEnterTarget)
|
||||
if (StomachEnterVisTimer && !StomachEnterTarget.IsEmpty())
|
||||
{
|
||||
if (StomachEnterVisTimer <= diff)
|
||||
{
|
||||
|
||||
@@ -133,7 +133,7 @@ public:
|
||||
{
|
||||
aqsentinelAI* cai = ENSURE_AI(aqsentinelAI, (c)->AI());
|
||||
for (int32 i = 0; i < 3; ++i)
|
||||
if (NearbyGUID[i] && NearbyGUID[i] != c->GetGUID())
|
||||
if (!NearbyGUID[i].IsEmpty() && NearbyGUID[i] != c->GetGUID())
|
||||
cai->AddBuddyToList(NearbyGUID[i]);
|
||||
cai->AddBuddyToList(me->GetGUID());
|
||||
}
|
||||
|
||||
@@ -451,7 +451,7 @@ public:
|
||||
|
||||
if (WaveTimer <= diff)
|
||||
{
|
||||
if (Wave < 6 && AffrayChallenger[Wave] && !EventBigWill)
|
||||
if (Wave < 6 && !AffrayChallenger[Wave].IsEmpty() && !EventBigWill)
|
||||
{
|
||||
Talk(SAY_TWIGGY_FLATHEAD_FRAY);
|
||||
Creature* creature = ObjectAccessor::GetCreature(*me, AffrayChallenger[Wave]);
|
||||
@@ -479,7 +479,7 @@ public:
|
||||
WaveTimer = 1000;
|
||||
}
|
||||
}
|
||||
else if (Wave >= 6 && EventBigWill && BigWill)
|
||||
else if (Wave >= 6 && EventBigWill && !BigWill.IsEmpty())
|
||||
{
|
||||
Creature* creature = ObjectAccessor::GetCreature(*me, BigWill);
|
||||
if (!creature || !creature->IsAlive())
|
||||
|
||||
+5
-5
@@ -394,7 +394,7 @@ public:
|
||||
}
|
||||
}else uiPhaseTimer -= uiDiff;
|
||||
|
||||
if (!UpdateVictim() || me->m_movementInfo.transport.guid)
|
||||
if (!UpdateVictim() || !me->m_movementInfo.transport.guid.IsEmpty())
|
||||
return;
|
||||
|
||||
if (uiInterceptTimer <= uiDiff)
|
||||
@@ -542,7 +542,7 @@ public:
|
||||
uiFireBallTimer = 5000;
|
||||
} else uiFireBallTimer -= uiDiff;
|
||||
|
||||
if (!UpdateVictim() || me->m_movementInfo.transport.guid)
|
||||
if (!UpdateVictim() || !me->m_movementInfo.transport.guid.IsEmpty())
|
||||
return;
|
||||
|
||||
if (uiFireBallTimer <= uiDiff)
|
||||
@@ -684,7 +684,7 @@ public:
|
||||
}
|
||||
}else uiPhaseTimer -= uiDiff;
|
||||
|
||||
if (!UpdateVictim() || me->m_movementInfo.transport.guid)
|
||||
if (!UpdateVictim() || !me->m_movementInfo.transport.guid.IsEmpty())
|
||||
return;
|
||||
|
||||
if (uiChainLightningTimer <= uiDiff)
|
||||
@@ -834,7 +834,7 @@ public:
|
||||
}
|
||||
}else uiPhaseTimer -= uiDiff;
|
||||
|
||||
if (!UpdateVictim() || me->m_movementInfo.transport.guid)
|
||||
if (!UpdateVictim() || !me->m_movementInfo.transport.guid.IsEmpty())
|
||||
return;
|
||||
|
||||
if (uiLightningArrowsTimer <= uiDiff)
|
||||
@@ -986,7 +986,7 @@ public:
|
||||
}
|
||||
} else uiPhaseTimer -= uiDiff;
|
||||
|
||||
if (!UpdateVictim() || me->m_movementInfo.transport.guid)
|
||||
if (!UpdateVictim() || !me->m_movementInfo.transport.guid.IsEmpty())
|
||||
return;
|
||||
|
||||
if (uiEviscerateTimer <= uiDiff)
|
||||
|
||||
@@ -225,7 +225,7 @@ class boss_gal_darah : public CreatureScript
|
||||
}
|
||||
|
||||
private:
|
||||
std::set<uint64> impaledPlayers;
|
||||
GuidSet impaledPlayers;
|
||||
uint8 _phaseCounter;
|
||||
};
|
||||
|
||||
|
||||
@@ -1162,7 +1162,7 @@ class npc_ball_of_flame : public CreatureScript
|
||||
|
||||
void MovementInform(uint32 type, uint32 id) override
|
||||
{
|
||||
if (type == CHASE_MOTION_TYPE && id == _chaseGUID.GetCounter() && _chaseGUID)
|
||||
if (type == CHASE_MOTION_TYPE && id == _chaseGUID.GetCounter() && !_chaseGUID.IsEmpty())
|
||||
{
|
||||
me->RemoveAurasDueToSpell(SPELL_BALL_OF_FLAMES_PERIODIC);
|
||||
DoCast(me, SPELL_FLAMES);
|
||||
|
||||
@@ -396,7 +396,7 @@ class boss_blood_queen_lana_thel : public CreatureScript
|
||||
break;
|
||||
}
|
||||
case EVENT_DELIRIOUS_SLASH:
|
||||
if (_offtankGUID && !me->HasByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER))
|
||||
if (!_offtankGUID.IsEmpty() && !me->HasByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER))
|
||||
if (Player* _offtank = ObjectAccessor::GetPlayer(*me, _offtankGUID))
|
||||
DoCast(_offtank, SPELL_DELIRIOUS_SLASH);
|
||||
events.ScheduleEvent(EVENT_DELIRIOUS_SLASH, urand(20000, 24000), EVENT_GROUP_NORMAL);
|
||||
|
||||
@@ -172,14 +172,14 @@ public:
|
||||
void SetGUID(ObjectGuid guid, int32 /*param*/) override
|
||||
{
|
||||
victimGUID = guid;
|
||||
if (me->m_spells[0] && victimGUID)
|
||||
if (me->m_spells[0] && !victimGUID.IsEmpty())
|
||||
if (Unit* victim = ObjectAccessor::GetUnit(*me, victimGUID))
|
||||
victim->CastSpell(victim, me->m_spells[0], true, NULL, NULL, me->GetGUID());
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
if (me->m_spells[0] && victimGUID)
|
||||
if (me->m_spells[0] && !victimGUID.IsEmpty())
|
||||
if (Unit* victim = ObjectAccessor::GetUnit(*me, victimGUID))
|
||||
victim->RemoveAurasDueToSpell(me->m_spells[0], me->GetGUID());
|
||||
}
|
||||
|
||||
@@ -2041,7 +2041,7 @@ class spell_scion_of_eternity_arcane_barrage : public SpellScriptLoader
|
||||
// in longer terms this means if spell picks target X then 2nd cast of this spell will pick smth else
|
||||
// and if 3rd picks X again 4th will pick smth else (by not limiting the cast to certain caster).
|
||||
if (targets.size() > 1)
|
||||
if (malygos && malygos->AI()->GetGUID(DATA_LAST_TARGET_BARRAGE_GUID))
|
||||
if (malygos && !malygos->AI()->GetGUID(DATA_LAST_TARGET_BARRAGE_GUID).IsEmpty())
|
||||
targets.remove_if(Trinity::ObjectGUIDCheck(malygos->AI()->GetGUID(DATA_LAST_TARGET_BARRAGE_GUID)));
|
||||
|
||||
// Remove players not on Hover Disk from second list
|
||||
|
||||
@@ -700,8 +700,8 @@ class npc_boombot : public CreatureScript
|
||||
_boomed = true; // Prevent recursive calls
|
||||
|
||||
WorldPacket data(SMSG_SPELLINSTAKILLLOG, 8+8+4);
|
||||
data << uint64(me->GetGUID());
|
||||
data << uint64(me->GetGUID());
|
||||
data << me->GetGUID();
|
||||
data << me->GetGUID();
|
||||
data << uint32(SPELL_BOOM);
|
||||
me->SendMessageToSet(&data, false);
|
||||
|
||||
|
||||
@@ -995,7 +995,7 @@ class instance_ulduar : public InstanceMapScript
|
||||
data << GetData(DATA_COLOSSUS) << ' ' << _algalonTimer << ' ' << uint32(_algalonSummoned ? 1 : 0);
|
||||
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
data << ' ' << uint32(KeeperGUIDs[i] ? 1 : 0);
|
||||
data << ' ' << uint32(!KeeperGUIDs[i].IsEmpty() ? 1 : 0);
|
||||
}
|
||||
|
||||
void ReadSaveDataMore(std::istringstream& data) override
|
||||
|
||||
@@ -803,7 +803,7 @@ public:
|
||||
|
||||
void UpdateAI(uint32 /*diff*/) override
|
||||
{
|
||||
if (WithRedDragonBlood && HarpoonerGUID && !me->HasAura(SPELL_RED_DRAGONBLOOD))
|
||||
if (WithRedDragonBlood && !HarpoonerGUID.IsEmpty() && !me->HasAura(SPELL_RED_DRAGONBLOOD))
|
||||
{
|
||||
if (Player* pHarpooner = ObjectAccessor::GetPlayer(*me, HarpoonerGUID))
|
||||
{
|
||||
|
||||
@@ -277,7 +277,7 @@ void OPvPCapturePointZM_GraveYard::SetBeaconState(uint32 controlling_faction)
|
||||
if (m_GraveYardState & ZM_GRAVEYARD_N)
|
||||
{
|
||||
// gy was neutral, thus neutral banner was spawned, it is possible that someone was taking the flag to the gy
|
||||
if (m_FlagCarrierGUID)
|
||||
if (!m_FlagCarrierGUID.IsEmpty())
|
||||
{
|
||||
// remove flag from carrier, reset flag carrier guid
|
||||
Player* p = ObjectAccessor::FindPlayer(m_FlagCarrierGUID);
|
||||
@@ -318,7 +318,7 @@ bool OPvPCapturePointZM_GraveYard::HandleGossipOption(Player* player, ObjectGuid
|
||||
if (!cr)
|
||||
return true;
|
||||
// if the flag is already taken, then return
|
||||
if (m_FlagCarrierGUID)
|
||||
if (!m_FlagCarrierGUID.IsEmpty())
|
||||
return true;
|
||||
if (itr->second == ZM_ALLIANCE_FIELD_SCOUT)
|
||||
{
|
||||
|
||||
+1
-1
@@ -756,7 +756,7 @@ public:
|
||||
if (!leotherasGUID)
|
||||
leotherasGUID = instance->GetGuidData(DATA_LEOTHERAS);
|
||||
|
||||
if (!me->IsInCombat() && instance->GetGuidData(DATA_LEOTHERAS_EVENT_STARTER))
|
||||
if (!me->IsInCombat() && !instance->GetGuidData(DATA_LEOTHERAS_EVENT_STARTER).IsEmpty())
|
||||
{
|
||||
Unit* victim = NULL;
|
||||
victim = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_LEOTHERAS_EVENT_STARTER));
|
||||
|
||||
@@ -99,7 +99,7 @@ class npc_warp_splinter_treant : public CreatureScript
|
||||
{
|
||||
if (!UpdateVictim() || !me->GetVictim())
|
||||
{
|
||||
if (WarpGuid && check_Timer <= diff)
|
||||
if (!WarpGuid.IsEmpty() && check_Timer <= diff)
|
||||
{
|
||||
if (Unit* Warp = ObjectAccessor::GetUnit(*me, WarpGuid))
|
||||
{
|
||||
|
||||
@@ -994,7 +994,7 @@ public:
|
||||
|
||||
if (ConversationTimer <= diff)
|
||||
{
|
||||
if (Event && PlayerGUID)
|
||||
if (Event && !PlayerGUID.IsEmpty())
|
||||
ConversationTimer = NextStep(++Step);
|
||||
} else ConversationTimer -= diff;
|
||||
}
|
||||
|
||||
@@ -947,10 +947,10 @@ class spell_hun_tame_beast : public SpellScriptLoader
|
||||
if (!target->GetCreatureTemplate()->IsTameable(caster->ToPlayer()->CanTameExoticPets()))
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
|
||||
if (caster->GetPetGUID())
|
||||
if (!caster->GetPetGUID().IsEmpty())
|
||||
return SPELL_FAILED_ALREADY_HAVE_SUMMON;
|
||||
|
||||
if (caster->GetCharmGUID())
|
||||
if (!caster->GetCharmGUID().IsEmpty())
|
||||
return SPELL_FAILED_ALREADY_HAVE_CHARM;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -316,7 +316,7 @@ public:
|
||||
DoCast(temp, SPELL_BANISHED_SHATTRATH_A);
|
||||
banishTimer = 9000;
|
||||
playerGUID = temp->GetGUID();
|
||||
if (playerGUID)
|
||||
if (!playerGUID.IsEmpty())
|
||||
canTeleport = true;
|
||||
}
|
||||
} else banishTimer -= diff;
|
||||
@@ -389,7 +389,7 @@ public:
|
||||
DoCast(temp, SPELL_BANISHED_SHATTRATH_S);
|
||||
banishTimer = 9000;
|
||||
playerGUID = temp->GetGUID();
|
||||
if (playerGUID)
|
||||
if (!playerGUID.IsEmpty())
|
||||
canTeleport = true;
|
||||
}
|
||||
} else banishTimer -= diff;
|
||||
|
||||
@@ -790,7 +790,7 @@ public:
|
||||
return;
|
||||
|
||||
if (player->GetQuestStatus(6624) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(6622) == QUEST_STATUS_INCOMPLETE)
|
||||
if (DoctorGUID)
|
||||
if (!DoctorGUID.IsEmpty())
|
||||
if (Creature* doctor = ObjectAccessor::GetCreature(*me, DoctorGUID))
|
||||
ENSURE_AI(npc_doctor::npc_doctorAI, doctor->AI())->PatientSaved(me, player, Coord);
|
||||
|
||||
@@ -836,7 +836,7 @@ public:
|
||||
me->setDeathState(JUST_DIED);
|
||||
me->SetFlag(UNIT_DYNAMIC_FLAGS, 32);
|
||||
|
||||
if (DoctorGUID)
|
||||
if (!DoctorGUID.IsEmpty())
|
||||
if (Creature* doctor = ObjectAccessor::GetCreature((*me), DoctorGUID))
|
||||
ENSURE_AI(npc_doctor::npc_doctorAI, doctor->AI())->PatientDied(Coord);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user