Merge branch '4.3.4' of https://gitlab.com/trinitycore/TrinityCore_434 into 4.3.4
# Conflicts: # src/server/game/Entities/Player/Player.cpp # src/server/game/Maps/Map.cpp # src/server/game/Maps/Map.h
This commit is contained in:
commit
617b3a8a11
172 files changed
+4534
-1342
No files matched your search
@@ -46,6 +46,7 @@
|
||||
#include "PassiveAI.h"
|
||||
#include "PetAI.h"
|
||||
#include "Pet.h"
|
||||
#include "PhasingHandler.h"
|
||||
#include "Player.h"
|
||||
#include "PlayerAI.h"
|
||||
#include "QuestDef.h"
|
||||
@@ -3147,12 +3148,12 @@ bool Unit::isInAccessiblePlaceFor(Creature const* c) const
|
||||
|
||||
bool Unit::IsInWater() const
|
||||
{
|
||||
return GetBaseMap()->IsInWater(GetPositionX(), GetPositionY(), GetPositionZ());
|
||||
return GetBaseMap()->IsInWater(GetPhaseShift(), GetPositionX(), GetPositionY(), GetPositionZ());
|
||||
}
|
||||
|
||||
bool Unit::IsUnderWater() const
|
||||
{
|
||||
return GetBaseMap()->IsUnderWater(GetPositionX(), GetPositionY(), GetPositionZ());
|
||||
return GetBaseMap()->IsUnderWater(GetPhaseShift(), GetPositionX(), GetPositionY(), GetPositionZ());
|
||||
}
|
||||
|
||||
void Unit::ProcessPositionDataChanged(PositionFullTerrainStatus const& data)
|
||||
@@ -3928,7 +3929,7 @@ void Unit::RemoveAurasWithAttribute(uint32 flags)
|
||||
}
|
||||
}
|
||||
|
||||
void Unit::RemoveNotOwnSingleTargetAuras(uint32 newPhase, bool phaseid)
|
||||
void Unit::RemoveNotOwnSingleTargetAuras(bool onPhaseChange /*= false*/)
|
||||
{
|
||||
// single target auras from other casters
|
||||
// Iterate m_ownedAuras - aura is marked as single target in Unit::AddAura (and pushed to m_ownedAuras).
|
||||
@@ -3945,12 +3946,12 @@ void Unit::RemoveNotOwnSingleTargetAuras(uint32 newPhase, bool phaseid)
|
||||
|
||||
if (aura->GetCasterGUID() != GetGUID() && aura->IsSingleTarget())
|
||||
{
|
||||
if (!newPhase && !phaseid)
|
||||
if (!onPhaseChange)
|
||||
RemoveOwnedAura(iter);
|
||||
else
|
||||
{
|
||||
Unit* caster = aura->GetCaster();
|
||||
if (!caster || (newPhase && !caster->IsInPhase(newPhase)) || (!newPhase && !caster->IsInPhase(this)))
|
||||
if (!caster || !caster->IsInPhase(this))
|
||||
RemoveOwnedAura(iter);
|
||||
else
|
||||
++iter;
|
||||
@@ -3965,7 +3966,7 @@ void Unit::RemoveNotOwnSingleTargetAuras(uint32 newPhase, bool phaseid)
|
||||
for (AuraList::iterator iter = scAuras.begin(); iter != scAuras.end();)
|
||||
{
|
||||
Aura* aura = *iter;
|
||||
if (aura->GetUnitOwner() != this && !aura->GetUnitOwner()->IsInPhase(newPhase))
|
||||
if (aura->GetUnitOwner() != this && !aura->GetUnitOwner()->IsInPhase(this))
|
||||
{
|
||||
aura->Remove();
|
||||
iter = scAuras.begin();
|
||||
@@ -5576,7 +5577,7 @@ bool Unit::Attack(Unit* victim, bool meleeAttack)
|
||||
//if (GetTypeId() == TYPEID_UNIT)
|
||||
// ToCreature()->SetCombatStartPosition(GetPositionX(), GetPositionY(), GetPositionZ());
|
||||
|
||||
if (creature && !IsPet())
|
||||
if (creature && !IsControlledByPlayer())
|
||||
{
|
||||
// should not let player enter combat by right clicking target - doesn't helps
|
||||
AddThreat(victim, 0.0f);
|
||||
@@ -8171,7 +8172,7 @@ MountCapabilityEntry const* Unit::GetMountCapability(uint32 mountType) const
|
||||
mountFlags = areaTable->MountFlags;
|
||||
|
||||
LiquidData liquid;
|
||||
ZLiquidStatus liquidStatus = GetMap()->GetLiquidStatus(GetPositionX(), GetPositionY(), GetPositionZ(), MAP_ALL_LIQUIDS, &liquid);
|
||||
ZLiquidStatus liquidStatus = GetMap()->GetLiquidStatus(GetPhaseShift(), GetPositionX(), GetPositionY(), GetPositionZ(), MAP_ALL_LIQUIDS, &liquid);
|
||||
isSubmerged = (liquidStatus & LIQUID_MAP_UNDER_WATER) != 0 || HasUnitMovementFlag(MOVEMENTFLAG_SWIMMING);
|
||||
isInWater = (liquidStatus & (LIQUID_MAP_IN_WATER | LIQUID_MAP_UNDER_WATER)) != 0;
|
||||
|
||||
@@ -10089,15 +10090,6 @@ int32 Unit::GetCreatePowers(Powers power) const
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Unit::AddToWorld()
|
||||
{
|
||||
if (!IsInWorld())
|
||||
{
|
||||
WorldObject::AddToWorld();
|
||||
}
|
||||
RebuildTerrainSwaps();
|
||||
}
|
||||
|
||||
void Unit::RemoveFromWorld()
|
||||
{
|
||||
// cleanup
|
||||
@@ -11419,7 +11411,7 @@ bool Unit::InitTamedPet(Pet* pet, uint8 level, uint32 spell_id)
|
||||
return false;
|
||||
}
|
||||
|
||||
pet->CopyPhaseFrom(this);
|
||||
PhasingHandler::InheritPhaseShift(pet, this);
|
||||
|
||||
pet->GetCharmInfo()->SetPetNumber(sObjectMgr->GeneratePetNumber(), true);
|
||||
// this enables pet details window (Shift+P)
|
||||
@@ -12526,14 +12518,12 @@ float Unit::MeleeSpellMissChance(const Unit* victim, WeaponAttackType attType, u
|
||||
return missChance;
|
||||
}
|
||||
|
||||
bool Unit::SetInPhase(uint32 id, bool update, bool apply)
|
||||
void Unit::OnPhaseChange()
|
||||
{
|
||||
bool res = WorldObject::SetInPhase(id, update, apply);
|
||||
|
||||
if (!IsInWorld())
|
||||
return res;
|
||||
return;
|
||||
|
||||
if (GetTypeId() == TYPEID_UNIT || (!ToPlayer()->IsGameMaster() && !ToPlayer()->GetSession()->PlayerLogout()))
|
||||
if (GetTypeId() == TYPEID_UNIT || !ToPlayer()->GetSession()->PlayerLogout())
|
||||
{
|
||||
HostileRefManager& refManager = getHostileRefManager();
|
||||
HostileReference* ref = refManager.getFirst();
|
||||
@@ -12563,19 +12553,6 @@ bool Unit::SetInPhase(uint32 id, bool update, bool apply)
|
||||
unit->getHostileRefManager().setOnlineOfflineState(ToCreature(), unit->IsInPhase(this));
|
||||
}
|
||||
}
|
||||
|
||||
for (ControlList::const_iterator itr = m_Controlled.begin(); itr != m_Controlled.end(); ++itr)
|
||||
if ((*itr)->GetTypeId() == TYPEID_UNIT)
|
||||
(*itr)->SetInPhase(id, true, apply);
|
||||
|
||||
for (uint8 i = 0; i < MAX_SUMMON_SLOT; ++i)
|
||||
if (m_SummonSlot[i])
|
||||
if (Creature* summon = GetMap()->GetCreature(m_SummonSlot[i]))
|
||||
summon->SetInPhase(id, true, apply);
|
||||
|
||||
RemoveNotOwnSingleTargetAuras(0, true);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
void Unit::UpdateObjectVisibility(bool forced)
|
||||
@@ -13356,7 +13333,7 @@ void Unit::_ExitVehicle(Position const* exitPosition)
|
||||
Movement::MoveSplineInit init(this);
|
||||
|
||||
// Creatures without inhabit type air should begin falling after exiting the vehicle
|
||||
if (GetTypeId() == TYPEID_UNIT && !CanFly() && height > GetMap()->GetWaterOrGroundLevel(GetPhases(), pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), &height) + 0.1f)
|
||||
if (GetTypeId() == TYPEID_UNIT && !CanFly() && height > GetMap()->GetWaterOrGroundLevel(GetPhaseShift(), pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), &height) + 0.1f)
|
||||
init.SetFall();
|
||||
|
||||
init.MoveTo(pos.GetPositionX(), pos.GetPositionY(), height, false);
|
||||
|
||||
Reference in new issue
Block a user