Core/Players: Use PlayerData::VirtualPlayerRealm instead of global GetVirtualRealmAddress() where possible
Port From (https://github.com/TrinityCore/TrinityCore/commit/88fea990ff1408b94076fb9dbd0c974908d6a731)
This commit is contained in:
@@ -438,10 +438,10 @@ namespace Game.Entities
|
||||
if (type != DuelCompleteType.Interrupted)
|
||||
{
|
||||
DuelWinner duelWinner = new();
|
||||
duelWinner.BeatenName = (type == DuelCompleteType.Won ? opponent.GetName() : GetName());
|
||||
duelWinner.WinnerName = (type == DuelCompleteType.Won ? GetName() : opponent.GetName());
|
||||
duelWinner.BeatenVirtualRealmAddress = Global.WorldMgr.GetVirtualRealmAddress();
|
||||
duelWinner.WinnerVirtualRealmAddress = Global.WorldMgr.GetVirtualRealmAddress();
|
||||
duelWinner.BeatenName = (type == DuelCompleteType.Won ? opponent : this).GetName();
|
||||
duelWinner.WinnerName = (type == DuelCompleteType.Won ? this : opponent).GetName();
|
||||
duelWinner.BeatenVirtualRealmAddress = (type == DuelCompleteType.Won ? opponent : this).m_playerData.VirtualPlayerRealm;
|
||||
duelWinner.WinnerVirtualRealmAddress = (type == DuelCompleteType.Won ? this : opponent).m_playerData.VirtualPlayerRealm;
|
||||
duelWinner.Fled = type != DuelCompleteType.Won;
|
||||
|
||||
SendMessageToSet(duelWinner, true);
|
||||
|
||||
@@ -2446,7 +2446,12 @@ namespace Game.Entities
|
||||
|
||||
SummonRequest summonRequest = new();
|
||||
summonRequest.SummonerGUID = summoner.GetGUID();
|
||||
summonRequest.SummonerVirtualRealmAddress = WorldMgr.GetVirtualRealmAddress();
|
||||
Player playerSummoner = summoner.ToPlayer();
|
||||
if (playerSummoner != null)
|
||||
summonRequest.SummonerVirtualRealmAddress = playerSummoner.m_playerData.VirtualPlayerRealm;
|
||||
else
|
||||
summonRequest.SummonerVirtualRealmAddress = Global.WorldMgr.GetVirtualRealmAddress();
|
||||
|
||||
summonRequest.AreaID = (int)summoner.GetZoneId();
|
||||
SendPacket(summonRequest);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user