From 628dffe7e25f9605a1369df37ca3541cbdf88f8c Mon Sep 17 00:00:00 2001 From: dystopm Date: Tue, 12 Sep 2023 00:40:53 -0300 Subject: [PATCH] JoinTeam: force C4 drop when changing to SPEC --- regamedll/dlls/API/CSPlayer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/regamedll/dlls/API/CSPlayer.cpp b/regamedll/dlls/API/CSPlayer.cpp index bd9e34cef..aba9845cc 100644 --- a/regamedll/dlls/API/CSPlayer.cpp +++ b/regamedll/dlls/API/CSPlayer.cpp @@ -43,8 +43,10 @@ EXT_FUNC bool CCSPlayer::JoinTeam(TeamName team) pPlayer->pev->deadflag = DEAD_DEAD; pPlayer->pev->health = 0; + if (pPlayer->m_bHasC4) + pPlayer->DropPlayerItem("weapon_c4"); + pPlayer->RemoveAllItems(TRUE); - pPlayer->m_bHasC4 = false; pPlayer->m_iTeam = SPECTATOR; pPlayer->m_iJoiningState = JOINED;