mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 15:58:04 +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);
|
pinfo.SetModerator(true);
|
||||||
uint8 oldFlag = pinfo.flags;
|
uint8 oldFlag = pinfo.flags;
|
||||||
pinfo.SetOwner(true);
|
pinfo.SetOwner(true);
|
||||||
|
|
||||||
Player* player = ObjectAccessor::FindPlayer(_ownerGUID);
|
|
||||||
|
|
||||||
WorldPacket data;
|
|
||||||
|
|
||||||
if (ShouldAnnouncePlayer(player))
|
|
||||||
{
|
|
||||||
MakeModeChange(&data, _ownerGUID, oldFlag);
|
|
||||||
SendToAll(&data);
|
|
||||||
}
|
|
||||||
|
|
||||||
FlagsNotify(pinfo.plrPtr);
|
FlagsNotify(pinfo.plrPtr);
|
||||||
|
|
||||||
if (exclaim && ShouldAnnouncePlayer(player))
|
Player* player = ObjectAccessor::FindPlayer(_ownerGUID);
|
||||||
|
if (player)
|
||||||
{
|
{
|
||||||
MakeOwnerChanged(&data, _ownerGUID);
|
if (ShouldAnnouncePlayer(player))
|
||||||
SendToAll(&data);
|
{
|
||||||
|
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