From 15e5c4bb98a92df90f5c30a615944bc3af8a4b0d Mon Sep 17 00:00:00 2001 From: Vaqtincha Date: Fri, 30 Apr 2021 00:33:30 +0500 Subject: [PATCH] New flag SF_PLAYEREQUIP_REMOVEWEAPONS --- regamedll/dlls/maprules.cpp | 6 ++++++ regamedll/dlls/maprules.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/regamedll/dlls/maprules.cpp b/regamedll/dlls/maprules.cpp index b9e27fbca..760b25fac 100644 --- a/regamedll/dlls/maprules.cpp +++ b/regamedll/dlls/maprules.cpp @@ -580,6 +580,12 @@ void CGamePlayerEquip::EquipPlayer(CBaseEntity *pEntity) return; CBasePlayer *pPlayer = static_cast(pEntity); + + if (RemoveWeapons()) + { + pPlayer->RemoveAllItems(FALSE); + } + for (int i = 0; i < MAX_EQUIP; i++) { if (FStringNull(m_weaponNames[i])) diff --git a/regamedll/dlls/maprules.h b/regamedll/dlls/maprules.h index 80da1c8db..35301d8f9 100644 --- a/regamedll/dlls/maprules.h +++ b/regamedll/dlls/maprules.h @@ -245,6 +245,7 @@ class CGameCounterSet: public CRulePointEntity #define MAX_EQUIP 32 #define SF_PLAYEREQUIP_USEONLY BIT(0) // If set, the game_player_equip entity will not equip respawning players, // but only react to direct triggering, equipping its activator. This makes its master obsolete. +#define SF_PLAYEREQUIP_REMOVEWEAPONS BIT(1) // Remove all weapons before give. // Sets the default player equipment class CGamePlayerEquip: public CRulePointEntity @@ -256,6 +257,7 @@ class CGamePlayerEquip: public CRulePointEntity public: bool UseOnly() const { return (pev->spawnflags & SF_PLAYEREQUIP_USEONLY) == SF_PLAYEREQUIP_USEONLY; } + bool RemoveWeapons() const { return (pev->spawnflags & SF_PLAYEREQUIP_REMOVEWEAPONS) == SF_PLAYEREQUIP_REMOVEWEAPONS; } private: void EquipPlayer(CBaseEntity *pPlayer);