Skip to content

Commit d9db24a

Browse files
committed
feat(weapons): add convar rd_autoaim_weapons
Allow disabling extra auto-aim support for autogun and prifle
1 parent bc531ee commit d9db24a

4 files changed

Lines changed: 12 additions & 0 deletions

File tree

src/game/client/swarm/c_asw_weapon.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ ConVar rd_drop_magazine_spin( "rd_drop_magazine_spin", "1000", FCVAR_NONE, "Amou
126126
ConVar rd_drop_magazine_lifetime( "rd_drop_magazine_lifetime", "4", FCVAR_NONE, "Time before a dropped magazine fades" );
127127
ConVar rd_strange_device_model( "rd_strange_device_model", "0", FCVAR_NONE, "Should items with strange devices attached display them in the world?" );
128128

129+
ConVar rd_autoaim_weapons("rd_autoaim_weapons", "1", FCVAR_NONE, "Enable auto-aim bonus for selected weapons (autogun, prifle)");
130+
129131
extern ConVar asw_use_particle_tracers;
130132
extern ConVar muzzleflash_light;
131133
extern ConVar rd_show_others_laser_pointer;

src/game/client/swarm/c_asw_weapon.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ class C_BreakableProp;
1717
class CASW_EquipItem;
1818
class C_RD_Weapon_Accessory;
1919

20+
extern ConVar rd_autoaim_weapons;
21+
2022
extern ConVar rd_ground_shooting;
2123

2224
class C_ASW_Weapon : public C_BaseCombatWeapon, public IASW_Client_Usable_Entity

src/game/shared/swarm/asw_weapon_autogun_shared.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ class CASW_Weapon_Autogun : public CASW_Weapon_Rifle
2828
//float GetFireRate( void ) { return 0.1f; }
2929

3030
virtual const float GetAutoAimAmount() { return 0.36f; }
31+
#ifdef CLIENT_DLL
32+
virtual const float GetAutoAimRadiusScale() { return rd_autoaim_weapons.GetBool() ? 1.5f : 1.0f; }
33+
#else
3134
virtual const float GetAutoAimRadiusScale() { return 1.5f; }
35+
#endif // CLIENT_DLL
3236
virtual bool ShouldFlareAutoaim() { return true; }
3337
virtual const Vector& GetBulletSpread( void );
3438

src/game/shared/swarm/asw_weapon_prifle_shared.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ class CASW_Weapon_PRifle : public CASW_Weapon_Rifle
2323
void Precache();
2424

2525
virtual const float GetAutoAimAmount() { return 0.26f; }
26+
#ifdef CLIENT_DLL
27+
virtual const float GetAutoAimRadiusScale() { return rd_autoaim_weapons.GetBool() ? 1.5f : 1.0f; }
28+
#else
2629
virtual const float GetAutoAimRadiusScale() { return 1.5f; }
30+
#endif // CLIENT_DLL
2731
virtual float GetFireRate();
2832
virtual float GetWeaponBaseDamageOverride();
2933
virtual int GetWeaponSkillId();

0 commit comments

Comments
 (0)