mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2025-01-27 05:58:00 +03:00
Add m_bCanShootOverride member (#527)
Add m_bCanShootOverride member Allow to override m_bCanShoot, for example able to fire at freeze time
This commit is contained in:
parent
895dabc3a1
commit
4f7252525e
@ -1,3 +1,3 @@
|
||||
majorVersion=5
|
||||
minorVersion=15
|
||||
minorVersion=16
|
||||
maintenanceVersion=0
|
||||
|
@ -537,6 +537,7 @@ void CCSPlayer::Reset()
|
||||
m_vecOldvAngle = g_vecZero;
|
||||
m_iWeaponInfiniteAmmo = 0;
|
||||
m_iWeaponInfiniteIds = 0;
|
||||
m_bCanShootOverride = false;
|
||||
}
|
||||
|
||||
void CCSPlayer::OnSpawn()
|
||||
|
@ -4894,7 +4894,12 @@ void EXT_FUNC UpdateClientData(const edict_t *ent, int sendweapons, struct clien
|
||||
cd->m_flNextAttack = pPlayer->m_flNextAttack;
|
||||
|
||||
int iUser3 = 0;
|
||||
if (pPlayer->m_bCanShoot && !pPlayer->m_bIsDefusing)
|
||||
|
||||
if (
|
||||
#ifdef REGAMEDLL_API
|
||||
pPlayer->CSPlayer()->m_bCanShootOverride ||
|
||||
#endif
|
||||
(pPlayer->m_bCanShoot && !pPlayer->m_bIsDefusing))
|
||||
iUser3 |= PLAYER_CAN_SHOOT;
|
||||
|
||||
if (g_pGameRules->IsFreezePeriod())
|
||||
|
@ -948,7 +948,11 @@ void CBasePlayerWeapon::ItemPostFrame()
|
||||
|
||||
// Can't shoot during the freeze period
|
||||
// Always allow firing in single player
|
||||
if ((m_pPlayer->m_bCanShoot && g_pGameRules->IsMultiplayer() && !g_pGameRules->IsFreezePeriod() && !m_pPlayer->m_bIsDefusing) || !g_pGameRules->IsMultiplayer())
|
||||
if (
|
||||
#ifdef REGAMEDLL_API
|
||||
m_pPlayer->CSPlayer()->m_bCanShootOverride ||
|
||||
#endif
|
||||
(m_pPlayer->m_bCanShoot && g_pGameRules->IsMultiplayer() && !g_pGameRules->IsFreezePeriod() && !m_pPlayer->m_bIsDefusing) || !g_pGameRules->IsMultiplayer())
|
||||
{
|
||||
PrimaryAttack();
|
||||
}
|
||||
|
@ -44,7 +44,8 @@ public:
|
||||
m_flRespawnPending(0),
|
||||
m_flSpawnProtectionEndTime(0),
|
||||
m_iWeaponInfiniteAmmo(0),
|
||||
m_iWeaponInfiniteIds(0)
|
||||
m_iWeaponInfiniteIds(0),
|
||||
m_bCanShootOverride(false)
|
||||
{
|
||||
m_szModel[0] = '\0';
|
||||
}
|
||||
@ -121,6 +122,7 @@ public:
|
||||
Vector m_vecOldvAngle;
|
||||
int m_iWeaponInfiniteAmmo;
|
||||
int m_iWeaponInfiniteIds;
|
||||
bool m_bCanShootOverride;
|
||||
};
|
||||
|
||||
// Inlines
|
||||
|
@ -38,7 +38,7 @@
|
||||
#include <API/CSInterfaces.h>
|
||||
|
||||
#define REGAMEDLL_API_VERSION_MAJOR 5
|
||||
#define REGAMEDLL_API_VERSION_MINOR 15
|
||||
#define REGAMEDLL_API_VERSION_MINOR 16
|
||||
|
||||
// CBasePlayer::Spawn hook
|
||||
typedef IHookChainClass<void, class CBasePlayer> IReGameHook_CBasePlayer_Spawn;
|
||||
|
Loading…
x
Reference in New Issue
Block a user