Core/Units: applied feedback from TC pull request for aura interrupt checkups
This commit is contained in:
1 parent
b306111498
commit
221ed21ed2
2 files changed
+16
-10
No files matched your search
@@ -409,6 +409,8 @@ Unit::Unit(bool isWorldObject) :
|
|||||||
|
|
||||||
_oldFactionId = 0;
|
_oldFactionId = 0;
|
||||||
_isWalkingBeforeCharm = false;
|
_isWalkingBeforeCharm = false;
|
||||||
|
|
||||||
|
_positionUpdateInfo = PositionUpdateInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
@@ -603,10 +605,10 @@ void Unit::UpdateSplinePosition()
|
|||||||
void Unit::InterruptMovementBasedAuras()
|
void Unit::InterruptMovementBasedAuras()
|
||||||
{
|
{
|
||||||
// TODO: Check if orientation transport offset changed instead of only global orientation
|
// TODO: Check if orientation transport offset changed instead of only global orientation
|
||||||
if (m_positionUpdateInfo.Turned)
|
if (_positionUpdateInfo.Turned)
|
||||||
RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TURNING);
|
RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TURNING);
|
||||||
|
|
||||||
if (m_positionUpdateInfo.Relocated && !GetVehicle())
|
if (_positionUpdateInfo.Relocated && !GetVehicle())
|
||||||
RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_MOVE);
|
RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_MOVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -13888,8 +13890,8 @@ bool Unit::UpdatePosition(float x, float y, float z, float orientation, bool tel
|
|||||||
|
|
||||||
UpdatePositionData();
|
UpdatePositionData();
|
||||||
|
|
||||||
m_positionUpdateInfo.Relocated = relocated;
|
_positionUpdateInfo.Relocated = relocated;
|
||||||
m_positionUpdateInfo.Turned = turn;
|
_positionUpdateInfo.Turned = turn;
|
||||||
|
|
||||||
return (relocated || turn);
|
return (relocated || turn);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -944,6 +944,14 @@ enum PlayerTotemType
|
|||||||
SUMMON_TYPE_TOTEM_AIR = 83
|
SUMMON_TYPE_TOTEM_AIR = 83
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct PositionUpdateInfo
|
||||||
|
{
|
||||||
|
PositionUpdateInfo() : Relocated(false), Turned(false) { }
|
||||||
|
|
||||||
|
bool Relocated;
|
||||||
|
bool Turned;
|
||||||
|
};
|
||||||
|
|
||||||
// delay time next attack to prevent client attack animation problems
|
// delay time next attack to prevent client attack animation problems
|
||||||
#define ATTACK_DISPLAY_DELAY 200
|
#define ATTACK_DISPLAY_DELAY 200
|
||||||
#define MAX_PLAYER_STEALTH_DETECT_RANGE 30.0f // max distance for detection targets by player
|
#define MAX_PLAYER_STEALTH_DETECT_RANGE 30.0f // max distance for detection targets by player
|
||||||
@@ -1995,12 +2003,6 @@ class TC_GAME_API Unit : public WorldObject
|
|||||||
void UpdateSplineMovement(uint32 t_diff);
|
void UpdateSplineMovement(uint32 t_diff);
|
||||||
void UpdateSplinePosition();
|
void UpdateSplinePosition();
|
||||||
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
bool Relocated = false;
|
|
||||||
bool Turned = false;
|
|
||||||
} m_positionUpdateInfo;
|
|
||||||
|
|
||||||
// player or player's pet
|
// player or player's pet
|
||||||
float GetCombatRatingReduction(CombatRating cr) const;
|
float GetCombatRatingReduction(CombatRating cr) const;
|
||||||
uint32 GetCombatRatingDamageReduction(CombatRating cr, float rate, float cap, uint32 damage) const;
|
uint32 GetCombatRatingDamageReduction(CombatRating cr, float rate, float cap, uint32 damage) const;
|
||||||
@@ -2040,6 +2042,8 @@ class TC_GAME_API Unit : public WorldObject
|
|||||||
time_t _lastDamagedTime; // Part of Evade mechanics
|
time_t _lastDamagedTime; // Part of Evade mechanics
|
||||||
|
|
||||||
SpellHistory* m_spellHistory;
|
SpellHistory* m_spellHistory;
|
||||||
|
|
||||||
|
PositionUpdateInfo _positionUpdateInfo;
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace Trinity
|
namespace Trinity
|
||||||
|
|||||||
Reference in new issue
Block a user