mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2025-01-28 06:28:04 +03:00
CSInterface Update: Add RemovePlayerItemEx
This commit is contained in:
parent
5fa0c4220e
commit
cbbda5ef21
@ -1,3 +1,3 @@
|
||||
majorVersion=5
|
||||
minorVersion=5
|
||||
minorVersion=6
|
||||
maintenanceVersion=0
|
||||
|
@ -132,7 +132,7 @@ EXT_FUNC bool CCSPlayer::JoinTeam(TeamName team)
|
||||
return true;
|
||||
}
|
||||
|
||||
EXT_FUNC bool CCSPlayer::RemovePlayerItem(const char *pszItemName)
|
||||
EXT_FUNC bool CCSPlayer::RemovePlayerItemEx(const char* pszItemName, bool bRemoveAmmo)
|
||||
{
|
||||
if (!pszItemName)
|
||||
return false;
|
||||
@ -249,8 +249,15 @@ EXT_FUNC bool CCSPlayer::RemovePlayerItem(const char *pszItemName)
|
||||
pPlayer->SetProgressBarTime(0);
|
||||
}
|
||||
|
||||
if (pItem->IsWeapon() && pItem == pPlayer->m_pActiveItem) {
|
||||
((CBasePlayerWeapon *)pItem)->RetireWeapon();
|
||||
if (pItem->IsWeapon())
|
||||
{
|
||||
if (pItem == pPlayer->m_pActiveItem) {
|
||||
((CBasePlayerWeapon *)pItem)->RetireWeapon();
|
||||
}
|
||||
|
||||
if (bRemoveAmmo) {
|
||||
pPlayer->m_rgAmmo[ pItem->PrimaryAmmoIndex() ] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (pPlayer->RemovePlayerItem(pItem)) {
|
||||
@ -268,6 +275,11 @@ EXT_FUNC bool CCSPlayer::RemovePlayerItem(const char *pszItemName)
|
||||
return false;
|
||||
}
|
||||
|
||||
EXT_FUNC bool CCSPlayer::RemovePlayerItem(const char *pszItemName)
|
||||
{
|
||||
return RemovePlayerItemEx(pszItemName, false);
|
||||
}
|
||||
|
||||
EXT_FUNC CBaseEntity *CCSPlayer::GiveNamedItemEx(const char *pszName)
|
||||
{
|
||||
CBasePlayer *pPlayer = BasePlayer();
|
||||
|
@ -79,6 +79,7 @@ public:
|
||||
virtual bool MakeBomber();
|
||||
virtual void ResetSequenceInfo();
|
||||
virtual void StartDeathCam();
|
||||
virtual bool RemovePlayerItemEx(const char* pszItemName, bool bRemoveAmmo);
|
||||
|
||||
CBasePlayer *BasePlayer() const;
|
||||
|
||||
|
@ -38,7 +38,7 @@
|
||||
#include <API/CSInterfaces.h>
|
||||
|
||||
#define REGAMEDLL_API_VERSION_MAJOR 5
|
||||
#define REGAMEDLL_API_VERSION_MINOR 5
|
||||
#define REGAMEDLL_API_VERSION_MINOR 6
|
||||
|
||||
// CBasePlayer::Spawn hook
|
||||
typedef IHookChainClass<void, class CBasePlayer> IReGameHook_CBasePlayer_Spawn;
|
||||
|
Loading…
x
Reference in New Issue
Block a user