Remove Damage Indications when entering game (fixes #29)

This commit is contained in:
def 2014-09-03 14:17:44 +02:00
parent f66febb009
commit 4133e642f8
6 changed files with 20 additions and 3 deletions

View file

@ -631,6 +631,8 @@ void CClient::OnEnterGame()
if (g_Config.m_ClDummy == 0) if (g_Config.m_ClDummy == 0)
m_LastDummyConnectTime = 0; m_LastDummyConnectTime = 0;
GameClient()->OnEnterGame();
} }
void CClient::EnterGame() void CClient::EnterGame()

View file

@ -83,5 +83,10 @@ void CDamageInd::OnRender()
Graphics()->QuadsEnd(); Graphics()->QuadsEnd();
} }
void CDamageInd::Reset()
{
for(int i = 0; i < m_NumItems;)
{
DestroyI(&m_aItems[i]);
}
}

View file

@ -31,6 +31,7 @@ public:
CDamageInd(); CDamageInd();
void Create(vec2 Pos, vec2 Dir); void Create(vec2 Pos, vec2 Dir);
void Reset();
virtual void OnRender(); virtual void OnRender();
}; };
#endif #endif

View file

@ -55,6 +55,11 @@ void CEffects::DamageIndicator(vec2 Pos, vec2 Dir)
m_pClient->m_pDamageind->Create(Pos, Dir); m_pClient->m_pDamageind->Create(Pos, Dir);
} }
void CEffects::ResetDamageIndicator()
{
m_pClient->m_pDamageind->Reset();
}
void CEffects::PowerupShine(vec2 Pos, vec2 size) void CEffects::PowerupShine(vec2 Pos, vec2 size)
{ {
if(!m_Add50hz) if(!m_Add50hz)

View file

@ -20,6 +20,7 @@ public:
void HammerHit(vec2 Pos); void HammerHit(vec2 Pos);
void AirJump(vec2 Pos); void AirJump(vec2 Pos);
void DamageIndicator(vec2 Pos, vec2 Dir); void DamageIndicator(vec2 Pos, vec2 Dir);
void ResetDamageIndicator();
void PlayerSpawn(vec2 Pos); void PlayerSpawn(vec2 Pos);
void PlayerDeath(vec2 Pos, int ClientID); void PlayerDeath(vec2 Pos, int ClientID);
void PowerupShine(vec2 Pos, vec2 Size); void PowerupShine(vec2 Pos, vec2 Size);

View file

@ -751,7 +751,10 @@ void CGameClient::OnShutdown()
m_pRaceDemo->OnShutdown(); m_pRaceDemo->OnShutdown();
} }
void CGameClient::OnEnterGame() {} void CGameClient::OnEnterGame()
{
g_GameClient.m_pEffects->ResetDamageIndicator();
}
void CGameClient::OnGameOver() void CGameClient::OnGameOver()
{ {