mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-24 14:16:31 +00:00
refactor(Core/Creature): Remove Inhabit Type (#9272)
This is in reference to issue: https://github.com/azerothcore/azerothcore-wotlk/issues/4361 This is comprised of a cherry pick and partial tc cherry pick:592516ae69dbadb6369c34cfa69efd12de860b4aa22bc236eb
This commit is contained in:
@@ -234,6 +234,7 @@ Player::Player(WorldSession* session): Unit(true), m_mover(this)
|
||||
|
||||
m_MirrorTimerFlags = UNDERWATER_NONE;
|
||||
m_MirrorTimerFlagsLast = UNDERWATER_NONE;
|
||||
m_isInWater = false;
|
||||
m_drunkTimer = 0;
|
||||
m_deathTimer = 0;
|
||||
m_deathExpireTime = 0;
|
||||
@@ -2087,6 +2088,24 @@ bool Player::IsFalling() const
|
||||
return GetPositionZ() < m_lastFallZ && !IsInFlight();
|
||||
}
|
||||
|
||||
void Player::SetInWater(bool apply)
|
||||
{
|
||||
if (m_isInWater == apply)
|
||||
return;
|
||||
|
||||
//define player in water by opcodes
|
||||
//move player's guid into HateOfflineList of those mobs
|
||||
//which can't swim and move guid back into ThreatList when
|
||||
//on surface.
|
||||
//TODO: exist also swimming mobs, and function must be symmetric to enter/leave water
|
||||
m_isInWater = apply;
|
||||
|
||||
// remove auras that need water/land
|
||||
RemoveAurasWithInterruptFlags(apply ? AURA_INTERRUPT_FLAG_NOT_ABOVEWATER : AURA_INTERRUPT_FLAG_NOT_UNDERWATER);
|
||||
|
||||
getHostileRefMgr().updateThreatTables();
|
||||
}
|
||||
|
||||
bool Player::IsInAreaTriggerRadius(const AreaTrigger* trigger) const
|
||||
{
|
||||
static const float delta = 5.0f;
|
||||
|
||||
@@ -1086,6 +1086,9 @@ public:
|
||||
|
||||
static bool BuildEnumData(PreparedQueryResult result, WorldPacket* data);
|
||||
|
||||
void SetInWater(bool apply);
|
||||
|
||||
[[nodiscard]] bool IsInWater() const override { return m_isInWater; }
|
||||
[[nodiscard]] bool IsFalling() const;
|
||||
bool IsInAreaTriggerRadius(const AreaTrigger* trigger) const;
|
||||
|
||||
@@ -2915,6 +2918,7 @@ private:
|
||||
int32 m_MirrorTimer[MAX_TIMERS];
|
||||
uint8 m_MirrorTimerFlags;
|
||||
uint8 m_MirrorTimerFlagsLast;
|
||||
bool m_isInWater;
|
||||
|
||||
// Current teleport data
|
||||
WorldLocation teleportStore_dest;
|
||||
|
||||
Reference in New Issue
Block a user