Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
This commit is contained in:
commit
3f3a32df34
218 files changed
+1060
-974
No files matched your search
@@ -3029,10 +3029,16 @@ void Unit::_AddAura(UnitAura* aura, Unit* caster)
|
||||
if (aura->IsRemoved())
|
||||
return;
|
||||
|
||||
aura->SetIsSingleTarget(caster && aura->GetSpellInfo()->IsSingleTarget());
|
||||
aura->SetIsSingleTarget(caster && (aura->GetSpellInfo()->IsSingleTarget() || aura->HasEffectType(SPELL_AURA_CONTROL_VEHICLE)));
|
||||
if (aura->IsSingleTarget())
|
||||
{
|
||||
ASSERT((IsInWorld() && !IsDuringRemoveFromWorld()) || (aura->GetCasterGUID() == GetGUID()));
|
||||
ASSERT((IsInWorld() && !IsDuringRemoveFromWorld()) || (aura->GetCasterGUID() == GetGUID()) ||
|
||||
(isBeingLoaded() && aura->HasEffectType(SPELL_AURA_CONTROL_VEHICLE)));
|
||||
/* @HACK: Player is not in world during loading auras.
|
||||
* Single target auras are not saved or loaded from database
|
||||
* but may be created as a result of aura links (player mounts with passengers)
|
||||
*/
|
||||
|
||||
// register single target aura
|
||||
caster->GetSingleCastAuras().push_back(aura);
|
||||
// remove other single target auras
|
||||
@@ -3040,7 +3046,7 @@ void Unit::_AddAura(UnitAura* aura, Unit* caster)
|
||||
for (Unit::AuraList::iterator itr = scAuras.begin(); itr != scAuras.end();)
|
||||
{
|
||||
if ((*itr) != aura &&
|
||||
(*itr)->GetSpellInfo()->IsSingleTargetWith(aura->GetSpellInfo()))
|
||||
(*itr)->IsSingleTargetWith(aura))
|
||||
{
|
||||
(*itr)->Remove();
|
||||
itr = scAuras.begin();
|
||||
@@ -16699,9 +16705,19 @@ bool Unit::SetDisableGravity(bool disable, bool packetOnly /*= false*/)
|
||||
return false;
|
||||
|
||||
if (disable)
|
||||
{
|
||||
AddUnitMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY);
|
||||
RemoveUnitMovementFlag(MOVEMENTFLAG_FALLING);
|
||||
}
|
||||
else
|
||||
{
|
||||
RemoveUnitMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY);
|
||||
if (!HasUnitMovementFlag(MOVEMENTFLAG_CAN_FLY))
|
||||
{
|
||||
m_movementInfo.SetFallTime(0);
|
||||
AddUnitMovementFlag(MOVEMENTFLAG_FALLING);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (disable)
|
||||
@@ -16736,9 +16752,19 @@ bool Unit::SetCanFly(bool enable)
|
||||
return false;
|
||||
|
||||
if (enable)
|
||||
{
|
||||
AddUnitMovementFlag(MOVEMENTFLAG_CAN_FLY);
|
||||
RemoveUnitMovementFlag(MOVEMENTFLAG_FALLING);
|
||||
}
|
||||
else
|
||||
RemoveUnitMovementFlag(MOVEMENTFLAG_CAN_FLY);
|
||||
{
|
||||
RemoveUnitMovementFlag(MOVEMENTFLAG_CAN_FLY | MOVEMENTFLAG_MASK_MOVING_FLY);
|
||||
if (!IsLevitating())
|
||||
{
|
||||
m_movementInfo.SetFallTime(0);
|
||||
AddUnitMovementFlag(MOVEMENTFLAG_FALLING);
|
||||
}
|
||||
}
|
||||
|
||||
if (enable)
|
||||
Movement::PacketSender(this, SMSG_SPLINE_MOVE_SET_FLYING, SMSG_MOVE_SET_CAN_FLY).Send();
|
||||
|
||||
Reference in new issue
Block a user