mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-24 06:06:23 +00:00
fix(Core/Channel): potential nullptr reference in Channel::SetOwner() (#17906)
This commit is contained in:
committed by
GitHub
parent
e1cec2bbcf
commit
8eed7ee531
@@ -884,23 +884,25 @@ void Channel::SetOwner(ObjectGuid guid, bool exclaim)
|
||||
pinfo.SetModerator(true);
|
||||
uint8 oldFlag = pinfo.flags;
|
||||
pinfo.SetOwner(true);
|
||||
|
||||
Player* player = ObjectAccessor::FindPlayer(_ownerGUID);
|
||||
|
||||
WorldPacket data;
|
||||
|
||||
if (ShouldAnnouncePlayer(player))
|
||||
{
|
||||
MakeModeChange(&data, _ownerGUID, oldFlag);
|
||||
SendToAll(&data);
|
||||
}
|
||||
|
||||
FlagsNotify(pinfo.plrPtr);
|
||||
|
||||
if (exclaim && ShouldAnnouncePlayer(player))
|
||||
Player* player = ObjectAccessor::FindPlayer(_ownerGUID);
|
||||
if (player)
|
||||
{
|
||||
MakeOwnerChanged(&data, _ownerGUID);
|
||||
SendToAll(&data);
|
||||
if (ShouldAnnouncePlayer(player))
|
||||
{
|
||||
WorldPacket data;
|
||||
|
||||
MakeModeChange(&data, _ownerGUID, oldFlag);
|
||||
SendToAll(&data);
|
||||
|
||||
if (exclaim)
|
||||
{
|
||||
// MakeOwnerChanged will reset the packet for us
|
||||
MakeOwnerChanged(&data, _ownerGUID);
|
||||
SendToAll(&data);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user