mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-09 09:38:19 +00:00
Use OnReset
function to reset damage indicators
The additional indirection with the `CEffects::ResetDamageIndicator` and `CDamageInd::Reset` functions to reset damage indicators is confusing and unnecessary. Always reset the damage indicators when disconnecting (in `OnReset`) instead of when entering the next game.
This commit is contained in:
parent
dac12c7afd
commit
cd2a20f1f4
|
@ -105,7 +105,7 @@ void CDamageInd::OnInit()
|
|||
Graphics()->QuadContainerUpload(m_DmgIndQuadContainerIndex);
|
||||
}
|
||||
|
||||
void CDamageInd::Reset()
|
||||
void CDamageInd::OnReset()
|
||||
{
|
||||
for(int i = 0; i < m_NumItems;)
|
||||
{
|
||||
|
|
|
@ -37,7 +37,7 @@ public:
|
|||
virtual int Sizeof() const override { return sizeof(*this); }
|
||||
|
||||
void Create(vec2 Pos, vec2 Dir, float Alpha);
|
||||
void Reset();
|
||||
virtual void OnReset() override;
|
||||
virtual void OnRender() override;
|
||||
virtual void OnInit() override;
|
||||
};
|
||||
|
|
|
@ -53,11 +53,6 @@ void CEffects::DamageIndicator(vec2 Pos, vec2 Dir, float Alpha)
|
|||
m_pClient->m_DamageInd.Create(Pos, Dir, Alpha);
|
||||
}
|
||||
|
||||
void CEffects::ResetDamageIndicator()
|
||||
{
|
||||
m_pClient->m_DamageInd.Reset();
|
||||
}
|
||||
|
||||
void CEffects::PowerupShine(vec2 Pos, vec2 Size, float Alpha)
|
||||
{
|
||||
if(!m_Add50hz)
|
||||
|
|
|
@ -26,7 +26,6 @@ public:
|
|||
void HammerHit(vec2 Pos, float Alpha = 1.0f);
|
||||
void AirJump(vec2 Pos, float Alpha = 1.0f);
|
||||
void DamageIndicator(vec2 Pos, vec2 Dir, float Alpha = 1.0f);
|
||||
void ResetDamageIndicator();
|
||||
void PlayerSpawn(vec2 Pos, float Alpha = 1.0f);
|
||||
void PlayerDeath(vec2 Pos, int ClientId, float Alpha = 1.0f);
|
||||
void PowerupShine(vec2 Pos, vec2 Size, float Alpha = 1.0f);
|
||||
|
|
|
@ -1010,7 +1010,6 @@ void CGameClient::OnShutdown()
|
|||
|
||||
void CGameClient::OnEnterGame()
|
||||
{
|
||||
m_Effects.ResetDamageIndicator();
|
||||
}
|
||||
|
||||
void CGameClient::OnGameOver()
|
||||
|
|
Loading…
Reference in a new issue