[9060] Fixed leave combat by timer.

This also fix some problems with stealth detection.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
laise 2009-12-25 05:39:54 +03:00 committed by VladimirMangos
parent 9ab5276eb9
commit ce30ed1852
2 changed files with 5 additions and 5 deletions

View file

@ -216,17 +216,17 @@ void Unit::Update( uint32 p_time )
// Check UNIT_STAT_MELEE_ATTACKING or UNIT_STAT_CHASE (without UNIT_STAT_FOLLOW in this case) so pets can reach far away // Check UNIT_STAT_MELEE_ATTACKING or UNIT_STAT_CHASE (without UNIT_STAT_FOLLOW in this case) so pets can reach far away
// targets without stopping half way there and running off. // targets without stopping half way there and running off.
// These flags are reset after target dies or another command is given. // These flags are reset after target dies or another command is given.
if( m_HostileRefManager.isEmpty() ) if (m_HostileRefManager.isEmpty())
{ {
// m_CombatTimer set at aura start and it will be freeze until aura removing // m_CombatTimer set at aura start and it will be freeze until aura removing
if ( m_CombatTimer <= p_time ) if (m_CombatTimer <= p_time)
ClearInCombat(); CombatStop();
else else
m_CombatTimer -= p_time; m_CombatTimer -= p_time;
} }
} }
if(uint32 base_att = getAttackTimer(BASE_ATTACK)) if (uint32 base_att = getAttackTimer(BASE_ATTACK))
{ {
setAttackTimer(BASE_ATTACK, (p_time >= base_att ? 0 : base_att - p_time) ); setAttackTimer(BASE_ATTACK, (p_time >= base_att ? 0 : base_att - p_time) );
} }

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 "9059" #define REVISION_NR "9060"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__