From 329a68cf12fb41fb35df127bb3710d4fa57a8196 Mon Sep 17 00:00:00 2001 From: dystopm Date: Mon, 11 Sep 2023 21:47:15 -0300 Subject: [PATCH 1/2] Adding return type to DropShield and DropPlayerItem --- regamedll/dlls/API/CSPlayer.cpp | 8 ++++---- regamedll/public/regamedll/API/CSPlayer.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/regamedll/dlls/API/CSPlayer.cpp b/regamedll/dlls/API/CSPlayer.cpp index 36c1d258b..bd9e34cef 100644 --- a/regamedll/dlls/API/CSPlayer.cpp +++ b/regamedll/dlls/API/CSPlayer.cpp @@ -310,14 +310,14 @@ EXT_FUNC void CCSPlayer::GiveShield(bool bDeploy) BasePlayer()->GiveShield(bDeploy); } -EXT_FUNC void CCSPlayer::DropShield(bool bDeploy) +EXT_FUNC CBaseEntity *CCSPlayer::DropShield(bool bDeploy) { - BasePlayer()->DropShield(bDeploy); + return BasePlayer()->DropShield(bDeploy); } -EXT_FUNC void CCSPlayer::DropPlayerItem(const char *pszItemName) +EXT_FUNC CBaseEntity *CCSPlayer::DropPlayerItem(const char *pszItemName) { - BasePlayer()->DropPlayerItem(pszItemName); + return BasePlayer()->DropPlayerItem(pszItemName); } EXT_FUNC bool CCSPlayer::RemoveShield() diff --git a/regamedll/public/regamedll/API/CSPlayer.h b/regamedll/public/regamedll/API/CSPlayer.h index f56b1c513..1e0978b16 100644 --- a/regamedll/public/regamedll/API/CSPlayer.h +++ b/regamedll/public/regamedll/API/CSPlayer.h @@ -66,8 +66,8 @@ class CCSPlayer: public CCSMonster { virtual CBaseEntity *GiveNamedItemEx(const char *pszName); virtual void GiveDefaultItems(); virtual void GiveShield(bool bDeploy = true); - virtual void DropShield(bool bDeploy = true); - virtual void DropPlayerItem(const char *pszItemName); + virtual CBaseEntity *DropShield(bool bDeploy = true); + virtual CBaseEntity* DropPlayerItem(const char *pszItemName); virtual bool RemoveShield(); virtual void RemoveAllItems(bool bRemoveSuit); virtual bool RemovePlayerItem(const char* pszItemName); From 628dffe7e25f9605a1369df37ca3541cbdf88f8c Mon Sep 17 00:00:00 2001 From: dystopm Date: Tue, 12 Sep 2023 00:40:53 -0300 Subject: [PATCH 2/2] 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;