diff --git a/game/neo/resource/NeoModEvents.res b/game/neo/resource/NeoModEvents.res index 9d62eb622..bffdd7628 100644 --- a/game/neo/resource/NeoModEvents.res +++ b/game/neo/resource/NeoModEvents.res @@ -107,6 +107,11 @@ } + "game_freezetime_end" + { + + } + // inherited from NT "game_round_end" { diff --git a/src/game/client/neo/c_neo_player.cpp b/src/game/client/neo/c_neo_player.cpp index 0b6563fae..1a76c8416 100644 --- a/src/game/client/neo/c_neo_player.cpp +++ b/src/game/client/neo/c_neo_player.cpp @@ -472,8 +472,13 @@ C_NEO_Player::C_NEO_Player() m_flTocFactor = 0.15f; memset(m_szNeoNameWDupeIdx, 0, sizeof(m_szNeoNameWDupeIdx)); - ClearLocalPlayerDmgReports(); m_szNameDupePos = 0; + + if (IsLocalPlayer()) + { + ListenForGameEvent( "game_freezetime_end" ); + ClearLocalPlayerDmgReports(); + } } C_NEO_Player::~C_NEO_Player() @@ -1187,8 +1192,6 @@ void C_NEO_Player::PreThink( void ) CLocalPlayerFilter filter; enginesound->SetPlayerDSP(filter, 0, true); - ClearLocalPlayerDmgReports(); - // Reset the cache of other players crosshair data on spawning in if (CHudCrosshair *crosshair = GET_HUDELEMENT(CHudCrosshair)) { @@ -2148,3 +2151,12 @@ void C_NEO_Player::ClearLocalPlayerDmgReports() NeoAllKDReportsClear(); } } + +void C_NEO_Player::FireGameEvent(IGameEvent* event) +{ + auto eventName = event->GetName(); + if (!Q_stricmp(eventName, "game_freezetime_end")) + { + NeoAllKDReportsClear(); + } +} \ No newline at end of file diff --git a/src/game/client/neo/c_neo_player.h b/src/game/client/neo/c_neo_player.h index 607d7185e..8ca4e11bf 100644 --- a/src/game/client/neo/c_neo_player.h +++ b/src/game/client/neo/c_neo_player.h @@ -47,6 +47,7 @@ class C_NEO_Player : public C_HL2MP_Player virtual void AddPoints(int score, bool bAllowNegativeScore, bool bIgnorePlayerTakeover = false); virtual void PreDataUpdate(DataUpdateType_t updateType) OVERRIDE; + virtual void FireGameEvent( IGameEvent * event ) override; // Should this object cast shadows? virtual ShadowType_t ShadowCastType( void ); diff --git a/src/game/client/neo/ui/neo_scoreboard.cpp b/src/game/client/neo/ui/neo_scoreboard.cpp index 4946f5147..78cf3a289 100644 --- a/src/game/client/neo/ui/neo_scoreboard.cpp +++ b/src/game/client/neo/ui/neo_scoreboard.cpp @@ -337,9 +337,11 @@ void CNEOScoreBoard::Update() const bool bLocalPlaying = (TEAM_JINRAI == iLocalPlayerTeam || TEAM_NSF == iLocalPlayerTeam); const bool bIsTeamplay = NEORules()->IsTeamplay(); - const bool bShowDamageInfo = pLocalPlayer->IsPlayerDead() - && NEORules()->InRoundState() - && bLocalPlaying; + const bool bShowDamageInfo = + bLocalPlaying + && ((pLocalPlayer->IsPlayerDead() && NEORules()->IsRoundOn()) + || (NEORules()->GetRoundStatus() == NeoRoundStatus::PreRoundFreeze + || NEORules()->GetRoundStatus() == NeoRoundStatus::Pause)); // Zero array every update m_iTotalPlayers = 0; @@ -434,7 +436,8 @@ void CNEOScoreBoard::Update() || (bIsTeamplay && iLocalPlayerTeam == pPlayerInfo->iTeam) // Team - See own team's classes || (bShowDamageInfo && ((pPlayerInfo->iDealtDmgs > 0 && pPlayerInfo->iDealtHits > 0) - || (pPlayerInfo->iTakenDmgs > 0 && pPlayerInfo->iTakenHits > 0))); // Dead and have damage dealt/taken + || (pPlayerInfo->iTakenDmgs > 0 && pPlayerInfo->iTakenHits > 0)) // Dead and have damage dealt/taken + && !(NEORules()->GetRoundStatus() == NeoRoundStatus::PreRoundFreeze || NEORules()->GetRoundStatus() == NeoRoundStatus::Pause)); if (bShowClass) { pPlayerInfo->iClass = (bIsImpersonating) @@ -585,11 +588,11 @@ void CNEOScoreBoard::OnMainLoop(const NeoUI::Mode eMode) const bool bIsTeamplay = NEORules()->IsTeamplay(); const bool bShowReadyUp = sv_neo_readyup_lobby.GetBool() && NEORules()->m_nRoundStatus == NeoRoundStatus::Idle; - const bool bShowDamageInfo = pLocalPlayer->IsPlayerDead() - && NEORules()->InRoundState() - && g_neoKillerInfos.bHasDmgInfos - && (pLocalPlayer->GetTeamNumber() == TEAM_JINRAI - || pLocalPlayer->GetTeamNumber() == TEAM_NSF); + const bool bShowDamageInfo = + g_neoKillerInfos.bHasDmgInfos + && (pLocalPlayer->GetTeamNumber() == TEAM_JINRAI || pLocalPlayer->GetTeamNumber() == TEAM_NSF) + && ((pLocalPlayer->IsPlayerDead() && NEORules()->IsRoundOn()) + || (NEORules()->GetRoundStatus() == NeoRoundStatus::PreRoundFreeze || NEORules()->GetRoundStatus() == NeoRoundStatus::Pause)); static CrosshairInfo staticXhairInfo = {}; bool bHasRanklessDog = false; diff --git a/src/game/shared/neo/neo_gamerules.cpp b/src/game/shared/neo/neo_gamerules.cpp index b6faeae68..edef756ce 100644 --- a/src/game/shared/neo/neo_gamerules.cpp +++ b/src/game/shared/neo/neo_gamerules.cpp @@ -4577,6 +4577,11 @@ void CNEORules::SetRoundStatus(NeoRoundStatus status) { pEntGameCfg->m_OnRoundStart.FireOutput(nullptr, pEntGameCfg); } + + if (IGameEvent* event = gameeventmanager->CreateEvent("game_freezetime_end")) + { + gameeventmanager->FireEvent(event); + } } #endif }