Skip to content

Commit

Permalink
[AZTH] Crossfaction battleground: fixed cache reset on disconnects
Browse files Browse the repository at this point in the history
  • Loading branch information
mik1893 committed Aug 17, 2016
1 parent ec7a174 commit ee6f152
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,11 @@ void CrossFaction::SetMorph(Player* player, bool value)
{
if (player)
{
SetFakeRaceAndMorph(player);

if (value)
{
if (GetFakeRace(player->GetGUID()) == 0 || GetFakeMorph(player->GetGUID()) == 0)
SetFakeRaceAndMorph(player);

player->setRace(GetFakeRace(player->GetGUID()));
player->SetDisplayId(GetFakeMorph(player->GetGUID()));
player->SetNativeDisplayId(GetFakeMorph(player->GetGUID()));
Expand Down Expand Up @@ -418,6 +419,9 @@ class CrossFactionPlayer : public PlayerScript
// Called when a player changes to a new map (after moving to new map)
void OnMapChanged(Player* player) override
{
if(player && player->GetBattleground())
sCrossFaction->DoForgetPlayersInBG(player->GetBattleground(), player);

sCrossFaction->UpdatePlayerTeam(player->GetGroup(), player->GetGUID());
}

Expand Down

0 comments on commit ee6f152

Please sign in to comment.