player_sustainammo
oops i missed this one
This commit is contained in:
parent
667a0005e0
commit
1cd666a1e8
@ -14,6 +14,8 @@ namespace gameplay
|
|||||||
{
|
{
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
|
utils::hook::detour pm_weapon_use_ammo_hook;
|
||||||
|
|
||||||
game::dvar_t* jump_slowDownEnable;
|
game::dvar_t* jump_slowDownEnable;
|
||||||
game::dvar_t* jump_enableFallDamage;
|
game::dvar_t* jump_enableFallDamage;
|
||||||
|
|
||||||
@ -53,6 +55,15 @@ namespace gameplay
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void pm_weapon_use_ammo_stub(game::playerState_s* ps, game::Weapon weapon,
|
||||||
|
bool is_alternate, int amount, game::PlayerHandIndex hand)
|
||||||
|
{
|
||||||
|
if (!dvars::player_sustainAmmo->current.enabled)
|
||||||
|
{
|
||||||
|
pm_weapon_use_ammo_hook.invoke<void>(ps, weapon, is_alternate, amount, hand);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const auto pm_bouncing_stub_mp = utils::hook::assemble([](utils::hook::assembler& a)
|
const auto pm_bouncing_stub_mp = utils::hook::assemble([](utils::hook::assembler& a)
|
||||||
{
|
{
|
||||||
const auto no_bounce = a.newLabel();
|
const auto no_bounce = a.newLabel();
|
||||||
@ -100,6 +111,10 @@ namespace gameplay
|
|||||||
public:
|
public:
|
||||||
void post_unpack() override
|
void post_unpack() override
|
||||||
{
|
{
|
||||||
|
dvars::player_sustainAmmo = dvars::register_bool("player_sustainAmmo", false,
|
||||||
|
game::DVAR_FLAG_REPLICATED, "Firing weapon will not decrease clip ammo");
|
||||||
|
pm_weapon_use_ammo_hook.create(SELECT_VALUE(0x14042E380, 0x1401F6B90), &pm_weapon_use_ammo_stub);
|
||||||
|
|
||||||
if (game::environment::is_sp())
|
if (game::environment::is_sp())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
@ -23,6 +23,7 @@ namespace dvars
|
|||||||
game::dvar_t* con_inputCmdMatchColor = nullptr;
|
game::dvar_t* con_inputCmdMatchColor = nullptr;
|
||||||
game::dvar_t* g_playerEjection = nullptr;
|
game::dvar_t* g_playerEjection = nullptr;
|
||||||
game::dvar_t* g_playerCollision = nullptr;
|
game::dvar_t* g_playerCollision = nullptr;
|
||||||
|
game::dvar_t* player_sustainAmmo = nullptr;
|
||||||
|
|
||||||
game::dvar_t* jump_enableFallDamage;
|
game::dvar_t* jump_enableFallDamage;
|
||||||
|
|
||||||
|
@ -26,6 +26,7 @@ namespace dvars
|
|||||||
extern game::dvar_t* con_inputCmdMatchColor;
|
extern game::dvar_t* con_inputCmdMatchColor;
|
||||||
extern game::dvar_t* g_playerEjection;
|
extern game::dvar_t* g_playerEjection;
|
||||||
extern game::dvar_t* g_playerCollision;
|
extern game::dvar_t* g_playerCollision;
|
||||||
|
extern game::dvar_t* player_sustainAmmo;
|
||||||
|
|
||||||
extern game::dvar_t* jump_enableFallDamage;
|
extern game::dvar_t* jump_enableFallDamage;
|
||||||
|
|
||||||
|
@ -1438,6 +1438,19 @@ namespace game
|
|||||||
float halfSize[3];
|
float halfSize[3];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum PlayerHandIndex
|
||||||
|
{
|
||||||
|
WEAPON_HAND_DEFAULT = 0x0,
|
||||||
|
WEAPON_HAND_RIGHT = 0x0,
|
||||||
|
WEAPON_HAND_LEFT = 0x1,
|
||||||
|
NUM_WEAPON_HANDS = 0x2,
|
||||||
|
};
|
||||||
|
|
||||||
|
union Weapon
|
||||||
|
{
|
||||||
|
unsigned int data;
|
||||||
|
};
|
||||||
|
|
||||||
namespace mp
|
namespace mp
|
||||||
{
|
{
|
||||||
struct cachedSnapshot_t
|
struct cachedSnapshot_t
|
||||||
|
Loading…
Reference in New Issue
Block a user