From db679357c84e61c979623b15b1454537c128cf56 Mon Sep 17 00:00:00 2001 From: Poggu Date: Wed, 18 Oct 2023 18:02:24 +0200 Subject: [PATCH] add alive check --- src/cs2_sdk/entity/ccsplayercontroller.h | 1 + src/events.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cs2_sdk/entity/ccsplayercontroller.h b/src/cs2_sdk/entity/ccsplayercontroller.h index bf5ce27f..914bba5b 100644 --- a/src/cs2_sdk/entity/ccsplayercontroller.h +++ b/src/cs2_sdk/entity/ccsplayercontroller.h @@ -29,6 +29,7 @@ class CCSPlayerController : public CBasePlayerController SCHEMA_FIELD(CCSPlayerController_InGameMoneyServices*, m_pInGameMoneyServices) SCHEMA_FIELD(CCSPlayerController_ActionTrackingServices*, m_pActionTrackingServices) + SCHEMA_FIELD(bool, m_bPawnIsAlive); static CCSPlayerController* FromPawn(CCSPlayerPawn* pawn) { return (CCSPlayerController*)pawn->m_hController().Get(); } }; \ No newline at end of file diff --git a/src/events.cpp b/src/events.cpp index 0801ae4b..6a74fe1c 100644 --- a/src/events.cpp +++ b/src/events.cpp @@ -175,7 +175,7 @@ GAME_EVENT_F(round_end) if(!pController) continue; - if (pController->m_iTeamNum == CS_TEAM_CT) + if (pController->m_iTeamNum == CS_TEAM_CT && pController->m_bPawnIsAlive) sortedPlayers.AddToTail(pPlayer); }