fix: POS_FIGHTING state
This commit is contained in:
@@ -1592,6 +1592,24 @@ void CHARACTER::SendDamagePacket(LPCHARACTER pAttacker, int Damage, BYTE DamageF
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef FIX_BATTLE_INACTIVITY_TIMEOUT
|
||||
void CHARACTER::EnterCombat()
|
||||
{
|
||||
if (!IsPC())
|
||||
return;
|
||||
|
||||
if (!IsPosition(POS_FIGHTING))
|
||||
{
|
||||
SetPosition(POS_FIGHTING);
|
||||
SetNextStatePulse(1);
|
||||
}
|
||||
|
||||
// Start the 10s window if it hasn't started yet.
|
||||
if (m_dwLastCombatTime == 0)
|
||||
m_dwLastCombatTime = get_dword_time();
|
||||
}
|
||||
#ifdef FIX_BATTLE_INACTIVITY_TIMEOUT
|
||||
|
||||
//
|
||||
// CHARACTER::Damage 메소드는 this가 데미지를 입게 한다.
|
||||
//
|
||||
@@ -2287,6 +2305,22 @@ bool CHARACTER::Damage(LPCHARACTER pAttacker, int dam, EDamageType type) // retu
|
||||
//
|
||||
if (!cannot_dead)
|
||||
{
|
||||
#ifdef FIX_BATTLE_INACTIVITY_TIMEOUT
|
||||
// REAL combat activity only: final damage > 0
|
||||
if (dam > 0)
|
||||
{
|
||||
// Victim received real damage
|
||||
UpdateLastCombatTime();
|
||||
EnterCombat();
|
||||
|
||||
// Attacker dealt real damage
|
||||
if (pAttacker)
|
||||
{
|
||||
pAttacker->UpdateLastCombatTime();
|
||||
pAttacker->EnterCombat();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
PointChange(POINT_HP, -dam, false);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user