Core/Entities: Phase Rework (main commit)

This commit is contained in:
Ovahlord committed 2018-03-08 22:58:50 +01:00
1 parent 4a268b3fd3
commit e44bb5f387
79 files changed
+1738 -851

No files matched your search

+9 -15
View File
@@ -65,6 +65,7 @@
#include "OutdoorPvP.h"
#include "OutdoorPvPMgr.h"
#include "Pet.h"
#include "PhasingHandler.h"
#include "QueryCallback.h"
#include "QuestDef.h"
#include "ReputationMgr.h"
@@ -2624,10 +2625,13 @@ void Player::SetGameMaster(bool on)
getHostileRefManager().setOnlineOfflineState(false);
CombatStopWithPets();
PhasingHandler::SetAlwaysVisible(GetPhaseShift(), true);
m_serverSideVisibilityDetect.SetValue(SERVERSIDE_VISIBILITY_GM, GetSession()->GetSecurity());
}
else
{
PhasingHandler::SetAlwaysVisible(GetPhaseShift(), false);
m_ExtraFlags &= ~ PLAYER_EXTRA_GM_ON;
SetFactionForRace(getRace());
RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_GM);
@@ -7380,7 +7384,7 @@ void Player::UpdateArea(uint32 newArea)
UpdatePvPState(true);
UpdateAreaDependentAuras(newArea);
UpdateAreaPhase();
PhasingHandler::OnAreaChange(this);
// previously this was in UpdateZone (but after UpdateArea) so nothing will break
pvpInfo.IsInNoPvPArea = false;
@@ -7485,8 +7489,6 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea)
UpdateLocalChannels(newZone);
UpdateZoneDependentAuras(newZone);
UpdateAreaPhase();
}
//If players are too far away from the duel flag... they lose the duel
@@ -16040,7 +16042,7 @@ void Player::SendQuestUpdate(uint32 questId)
}
UpdateForQuestWorldObjects();
SendUpdatePhasing();
PhasingHandler::OnConditionChange(this);
}
QuestGiverStatus Player::GetQuestDialogStatus(Object* questgiver)
@@ -23250,6 +23252,8 @@ void Player::SendInitialPacketsAfterAddToMap()
else
ClearQuestSharingInfo();
}
PhasingHandler::OnMapChange(this);
}
void Player::SendUpdateToOutOfRangeGroupMembers()
@@ -27327,7 +27331,7 @@ Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetTy
return nullptr;
}
pet->CopyPhaseFrom(this);
PhasingHandler::InheritPhaseShift(pet, this);
pet->SetCreatorGUID(GetGUID());
pet->SetFaction(GetFaction());
@@ -27699,16 +27703,6 @@ void Player::ReadMovementInfo(WorldPacket& data, MovementInfo* mi, Movement::Ext
#undef REMOVE_VIOLATING_FLAGS
}
void Player::SendUpdatePhasing()
{
if (!IsInWorld())
return;
RebuildTerrainSwaps(); // to set default map swaps
GetSession()->SendSetPhaseShift(GetPhases(), GetTerrainSwaps(), GetWorldMapAreaSwaps());
}
void Player::SendSupercededSpell(uint32 oldSpell, uint32 newSpell) const
{
WorldPacket data(SMSG_SUPERCEDED_SPELL, 8);