[7529] Hide some implementation details for fall damage calculation and breath timers.

This commit is contained in:
VladimirMangos 2009-03-24 02:25:01 +03:00
parent f9a2674ce3
commit 16ab4b6849
4 changed files with 20 additions and 9 deletions

View file

@ -271,8 +271,7 @@ void WorldSession::HandleMovementOpcodes( WorldPacket & recv_data )
} }
} }
if (GetPlayer()->m_lastFallTime >= movementInfo.fallTime || GetPlayer()->m_lastFallZ <=movementInfo.z || recv_data.GetOpcode() == MSG_MOVE_FALL_LAND) GetPlayer()->UpdateFallInformationIfNeed(movementInfo,MSG_MOVE_FALL_LAND);
GetPlayer()->SetFallInformation(movementInfo.fallTime, movementInfo.z);
if(GetPlayer()->isMovingOrTurning()) if(GetPlayer()->isMovingOrTurning())
GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH); GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);

View file

@ -459,6 +459,9 @@ Player::Player (WorldSession *session): Unit(), m_achievementMgr(this)
m_declinedname = NULL; m_declinedname = NULL;
m_runes = NULL; m_runes = NULL;
m_lastFallTime = 0;
m_lastFallZ = 0;
} }
Player::~Player () Player::~Player ()
@ -20210,3 +20213,9 @@ void Player::UpdateKnownCurrencies(uint32 itemId, bool apply)
RemoveFlag64(PLAYER_FIELD_KNOWN_CURRENCIES,(1LL << (ctEntry->BitIndex-1))); RemoveFlag64(PLAYER_FIELD_KNOWN_CURRENCIES,(1LL << (ctEntry->BitIndex-1)));
} }
} }
void Player::UpdateFallInformationIfNeed( MovementInfo const& minfo,uint16 opcode )
{
if (m_lastFallTime >= minfo.fallTime || m_lastFallZ <=minfo.z || opcode == MSG_MOVE_FALL_LAND)
SetFallInformation(minfo.fallTime, minfo.z);
}

View file

@ -1942,8 +1942,7 @@ class MANGOS_DLL_SPEC Player : public Unit
/*** VARIOUS SYSTEMS ***/ /*** VARIOUS SYSTEMS ***/
/*********************************************************/ /*********************************************************/
MovementInfo m_movementInfo; MovementInfo m_movementInfo;
uint32 m_lastFallTime; void UpdateFallInformationIfNeed(MovementInfo const& minfo,uint16 opcode);
float m_lastFallZ;
Unit *m_mover; Unit *m_mover;
void SetFallInformation(uint32 time, float z) void SetFallInformation(uint32 time, float z)
{ {
@ -2185,10 +2184,6 @@ class MANGOS_DLL_SPEC Player : public Unit
void StopMirrorTimer(MirrorTimerType Type); void StopMirrorTimer(MirrorTimerType Type);
void HandleDrowning(uint32 time_diff); void HandleDrowning(uint32 time_diff);
int32 getMaxTimer(MirrorTimerType timer); int32 getMaxTimer(MirrorTimerType timer);
int32 m_MirrorTimer[MAX_TIMERS];
uint8 m_MirrorTimerFlags;
uint8 m_MirrorTimerFlagsLast;
bool m_isInWater;
/*********************************************************/ /*********************************************************/
/*** HONOR SYSTEM ***/ /*** HONOR SYSTEM ***/
@ -2353,6 +2348,14 @@ class MANGOS_DLL_SPEC Player : public Unit
GridReference<Player> m_gridRef; GridReference<Player> m_gridRef;
MapReference m_mapRef; MapReference m_mapRef;
uint32 m_lastFallTime;
float m_lastFallZ;
int32 m_MirrorTimer[MAX_TIMERS];
uint8 m_MirrorTimerFlags;
uint8 m_MirrorTimerFlagsLast;
bool m_isInWater;
}; };
void AddItemsSetItem(Player*player,Item *item); void AddItemsSetItem(Player*player,Item *item);

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "7528" #define REVISION_NR "7529"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__