Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit f32fbf4

Browse files
committed
Make impulse damage proportional to actor max health
Instead of arbitrarily being on a scale from 0 to 100. This will only be a change to actors who have max health different than 100.
1 parent e821315 commit f32fbf4

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Entities/Actor.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1508,10 +1508,8 @@ void Actor::Update()
15081508
if (m_TravelImpulse.GetMagnitude() > m_TravelImpulseDamage)
15091509
{
15101510
m_PainSound.Play(m_Pos);
1511-
// TODO: IMPROVE AND DON'T HARDCODE
1512-
//m_Health -= 10;
1513-
float impulse = m_TravelImpulse.GetMagnitude() - m_TravelImpulseDamage;
1514-
float damage = impulse / (m_GibImpulseLimit - m_TravelImpulseDamage) * 100;
1511+
const float impulse = m_TravelImpulse.GetMagnitude() - m_TravelImpulseDamage;
1512+
const float damage = impulse / (m_GibImpulseLimit - m_TravelImpulseDamage) * m_MaxHealth;
15151513
if (damage > 0)
15161514
m_Health -= damage;
15171515
if (m_Status != DYING && m_Status != DEAD)

0 commit comments

Comments
 (0)