From 2cacad2c2ff9a6cf0fd718fbbea03f7afe2ec2a4 Mon Sep 17 00:00:00 2001 From: Peter0x44 Date: Sun, 30 Jun 2024 20:33:58 -0700 Subject: [PATCH] CLIENT: Add cvar for toggling rumble --- source/client/main.qc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/client/main.qc b/source/client/main.qc index 738b348..3e5af8f 100644 --- a/source/client/main.qc +++ b/source/client/main.qc @@ -81,6 +81,7 @@ noref void(float apiver, string enginename, float enginever) CSQC_Init = cvar_set("r_fb_models", ftos(0)); autocvar(r_viewmodel_default_fov, 70); autocvar(cl_controllerglyphs, "xbox"); + autocvar(in_rumbleenabled, 1); // Runtime check if we're running this in WebASM/WebGL. if (cvar_string("sys_platform") == "Web") @@ -1166,7 +1167,11 @@ noref void() CSQC_Parse_Event = screenflash_starttime = time; break; case CSQC_EVENT_RUMBLE: - gp_rumble(last_input_deviceid, readshort(), readshort(), readshort()); + float low_frequency = readshort(); + float high_frequency = readshort(); + float duration = readshort(); + if (cvar("in_rumbleenabled")) + gp_rumble(last_input_deviceid, low_frequency, high_frequency, duration); break; case EVENT_WEAPONRECOIL: local vector rec;