Skip to content
Prev Previous commit
Next Next commit
Implement g_fire_reloads_ubgl cvar, add missing FireEnd to fire h…
…andler
  • Loading branch information
ProfLander committed Aug 8, 2025
commit c52ca7e89db3e88c519fd8d41964ad626a424ee8
17 changes: 6 additions & 11 deletions src/xrGame/WeaponMagazinedWGrenade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
# include "phdebug.h"
#endif

BOOL g_fire_reloads_ubgl = TRUE;

CWeaponMagazinedWGrenade::CWeaponMagazinedWGrenade(ESoundTypes eSoundType) : CWeaponMagazined(eSoundType)
{
m_ammoType2 = 0;
Expand Down Expand Up @@ -313,12 +315,15 @@ bool CWeaponMagazinedWGrenade::Action(u16 cmd, u32 flags)
LaunchGrenade();
else
FireStart();
else
else if(g_fire_reloads_ubgl)
Reload();

if (GetState() == eIdle)
OnEmptyClick();
}
else
FireEnd();

return true;
}

Expand Down Expand Up @@ -499,16 +504,6 @@ void CWeaponMagazinedWGrenade::LaunchGrenade()
}
}

void CWeaponMagazinedWGrenade::FireEnd()
{
if (m_bGrenadeMode)
{
CWeapon::FireEnd();
}
else
inherited::FireEnd();
}

void CWeaponMagazinedWGrenade::OnMagazineEmpty()
{
if (GetState() == eIdle)
Expand Down
1 change: 0 additions & 1 deletion src/xrGame/WeaponMagazinedWGrenade.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class CWeaponMagazinedWGrenade : public CWeaponMagazined,
virtual bool UseScopeTexture();
virtual float CurrentZoomFactor();
virtual u8 GetCurrentHudOffsetIdx();
virtual void FireEnd();
void LaunchGrenade();

virtual void OnStateSwitch(u32 S, u32 oldState);
Expand Down
4 changes: 4 additions & 0 deletions src/xrGame/console_commands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,8 @@ extern float wallmark_range_skeleton;

ENGINE_API extern float g_console_sensitive;

extern BOOL g_fire_reloads_ubgl;

u32 g_dead_body_collision = 1;

xr_token dead_body_collision_tokens[] =
Expand Down Expand Up @@ -2577,6 +2579,8 @@ void CCC_RegisterCommands()
CMD4(CCC_Integer, "g_nearwall", &g_nearwall, 0, 2);
CMD4(CCC_Integer, "g_nearwall_trace", &g_nearwall_trace, 0, 1);

CMD4(CCC_Integer, "g_fire_reloads_ubgl", &g_fire_reloads_ubgl, 0, 1);

CMD3(CCC_Mask, "g_crosshair_show_always", &psCrosshair_Flags, CROSSHAIR_SHOW_ALWAYS);
CMD3(CCC_Mask, "g_crosshair_independent", &psCrosshair_Flags, CROSSHAIR_INDEPENDENT);

Expand Down