diff --git a/gradle.properties b/gradle.properties index a382be98..66a24d06 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ majorVersion=5 -minorVersion=15 +minorVersion=16 maintenanceVersion=0 diff --git a/regamedll/dlls/API/CSPlayer.cpp b/regamedll/dlls/API/CSPlayer.cpp index 4fd70c23..30892e2f 100644 --- a/regamedll/dlls/API/CSPlayer.cpp +++ b/regamedll/dlls/API/CSPlayer.cpp @@ -537,6 +537,7 @@ void CCSPlayer::Reset() m_vecOldvAngle = g_vecZero; m_iWeaponInfiniteAmmo = 0; m_iWeaponInfiniteIds = 0; + m_bCanShootOverride = false; } void CCSPlayer::OnSpawn() diff --git a/regamedll/dlls/client.cpp b/regamedll/dlls/client.cpp index c9b803eb..851db428 100644 --- a/regamedll/dlls/client.cpp +++ b/regamedll/dlls/client.cpp @@ -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()) diff --git a/regamedll/dlls/weapons.cpp b/regamedll/dlls/weapons.cpp index 8478e83d..5b753bb4 100644 --- a/regamedll/dlls/weapons.cpp +++ b/regamedll/dlls/weapons.cpp @@ -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(); } diff --git a/regamedll/public/regamedll/API/CSPlayer.h b/regamedll/public/regamedll/API/CSPlayer.h index 7fa8fac9..33678185 100644 --- a/regamedll/public/regamedll/API/CSPlayer.h +++ b/regamedll/public/regamedll/API/CSPlayer.h @@ -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 diff --git a/regamedll/public/regamedll/regamedll_api.h b/regamedll/public/regamedll/regamedll_api.h index 5ba789e0..d0c6e8d5 100644 --- a/regamedll/public/regamedll/regamedll_api.h +++ b/regamedll/public/regamedll/regamedll_api.h @@ -38,7 +38,7 @@ #include #define REGAMEDLL_API_VERSION_MAJOR 5 -#define REGAMEDLL_API_VERSION_MINOR 15 +#define REGAMEDLL_API_VERSION_MINOR 16 // CBasePlayer::Spawn hook typedef IHookChainClass IReGameHook_CBasePlayer_Spawn;