diff --git a/src/game/Player.cpp b/src/game/Player.cpp index b45d431f5ae..17894cb044b 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -414,7 +414,7 @@ Player::Player(WorldSession* session): Unit(), m_mover(this), m_camera(this), m_ m_zoneUpdateId = 0; m_zoneUpdateTimer = 0; - m_liquidUpdateTimer = 0; + m_positionStatusUpdateTimer = 0; m_areaUpdateId = 0; @@ -1273,12 +1273,12 @@ void Player::Update(uint32 update_diff, uint32 p_time) m_regenTimer -= update_diff; } - if (m_liquidUpdateTimer) + if (m_positionStatusUpdateTimer) { - if (update_diff >= m_liquidUpdateTimer) - m_liquidUpdateTimer = 0; + if (update_diff >= m_positionStatusUpdateTimer) + m_positionStatusUpdateTimer = 0; else - m_liquidUpdateTimer -= update_diff; + m_positionStatusUpdateTimer -= update_diff; } if (m_weaponChangeTimer > 0) @@ -6050,9 +6050,14 @@ bool Player::SetPosition(float x, float y, float z, float orientation, bool tele GetSession()->SendCancelTrade(); // will close both side trade windows } + if (m_positionStatusUpdateTimer) // Update position's state only on interval + return true; + m_positionStatusUpdateTimer = 100; + // code block for underwater state update UpdateUnderwaterState(m, x, y, z); + // code block for outdoor state and area-explore check CheckAreaExploreAndOutdoor(); return true; @@ -21532,12 +21537,6 @@ void Player::SetOriginalGroup(Group* group, int8 subgroup) void Player::UpdateUnderwaterState(Map* m, float x, float y, float z) { - // Update only on interval - if (m_liquidUpdateTimer) - return; - else - m_liquidUpdateTimer = 100; - GridMapLiquidData liquid_status; GridMapLiquidStatus res = m->GetTerrain()->getLiquidStatus(x, y, z, MAP_ALL_LIQUIDS, &liquid_status); if (!res) @@ -21577,7 +21576,7 @@ void Player::UpdateUnderwaterState(Map* m, float x, float y, float z) { SummonCreature(21508, 0, 0, 0, 0, TEMPSUMMON_TIMED_OOC_DESPAWN, 2000); // Special update timer for the SSC water - m_liquidUpdateTimer = 2000; + m_positionStatusUpdateTimer = 2000; } } } diff --git a/src/game/Player.h b/src/game/Player.h index dd6b8e074c7..c9d1b2871d6 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -1898,7 +1898,7 @@ class MANGOS_DLL_SPEC Player : public Unit void SetSemaphoreTeleportFar(bool semphsetting) { mSemaphoreTeleport_Far = semphsetting; } void ProcessDelayedOperations(); - void CheckAreaExploreAndOutdoor(void); + void CheckAreaExploreAndOutdoor(); static Team TeamForRace(uint8 race); Team GetTeam() const { return m_team; } @@ -2502,7 +2502,7 @@ class MANGOS_DLL_SPEC Player : public Unit uint32 m_zoneUpdateId; uint32 m_zoneUpdateTimer; uint32 m_areaUpdateId; - uint32 m_liquidUpdateTimer; + uint32 m_positionStatusUpdateTimer; uint32 m_deathTimer; time_t m_deathExpireTime; diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 66bfe6b18c5..4a1f36622ba 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "12371" + #define REVISION_NR "12372" #endif // __REVISION_NR_H__