]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Don't create useless client-side weapon autocvars; move a few tuba cvars from server... 1456/head
authorterencehill <piuntn@gmail.com>
Sun, 2 Feb 2025 23:52:01 +0000 (00:52 +0100)
committerterencehill <piuntn@gmail.com>
Mon, 3 Feb 2025 19:11:43 +0000 (20:11 +0100)
bal-wep-mario.cfg
bal-wep-nexuiz25.cfg
bal-wep-samual.cfg
bal-wep-xdf.cfg
bal-wep-xonotic.cfg
qcsrc/common/weapons/all.qh
qcsrc/common/weapons/weapon/tuba.qc
qcsrc/common/weapons/weapon/tuba.qh
xonotic-client.cfg

index 1872ac6f1c79230a74401773faf428558f303d47..f64269b41750d43aaa85e915f3591f95a66c36b0 100644 (file)
@@ -532,14 +532,11 @@ set g_balance_tuba_animtime 0.05
 set g_balance_tuba_attenuation 0.5
 set g_balance_tuba_damage 5
 set g_balance_tuba_edgedamage 0
-set g_balance_tuba_fadetime 0.25
 set g_balance_tuba_force 40
-set g_balance_tuba_pitchstep 6
 set g_balance_tuba_radius 200
 set g_balance_tuba_refire 0.05
 set g_balance_tuba_switchdelay_drop 0.2
 set g_balance_tuba_switchdelay_raise 0.2
-set g_balance_tuba_volume 1
 set g_balance_tuba_weaponreplace ""
 set g_balance_tuba_weaponstart 0
 set g_balance_tuba_weaponstartoverride -1
index b2e90d5bf4edf9cc1e23b39fddb32ae0339d323b..98391a968fd43e14dd76a78791019a0c0b286b33 100644 (file)
@@ -532,14 +532,11 @@ set g_balance_tuba_animtime 0.05
 set g_balance_tuba_attenuation 0.5
 set g_balance_tuba_damage 5
 set g_balance_tuba_edgedamage 0
-set g_balance_tuba_fadetime 0.25
 set g_balance_tuba_force 40
-set g_balance_tuba_pitchstep 6
 set g_balance_tuba_radius 200
 set g_balance_tuba_refire 0.05
 set g_balance_tuba_switchdelay_drop 0.15
 set g_balance_tuba_switchdelay_raise 0.15
-set g_balance_tuba_volume 1
 set g_balance_tuba_weaponreplace ""
 set g_balance_tuba_weaponstart 0
 set g_balance_tuba_weaponstartoverride -1
index ee1f7f3a7743b2a6b5f424cef047132a9df447a5..90bde59dec0bc4d1c841f947d9b7e9f94c065aaf 100644 (file)
@@ -532,14 +532,11 @@ set g_balance_tuba_animtime 0.05
 set g_balance_tuba_attenuation 0.5
 set g_balance_tuba_damage 5
 set g_balance_tuba_edgedamage 0
-set g_balance_tuba_fadetime 0.25
 set g_balance_tuba_force 40
-set g_balance_tuba_pitchstep 6
 set g_balance_tuba_radius 200
 set g_balance_tuba_refire 0.05
 set g_balance_tuba_switchdelay_drop 0.2
 set g_balance_tuba_switchdelay_raise 0.2
-set g_balance_tuba_volume 1
 set g_balance_tuba_weaponreplace ""
 set g_balance_tuba_weaponstart 0
 set g_balance_tuba_weaponstartoverride -1
index cbbb00f2896f3a65abe3f8f1f6544669833112b7..540c490a7d9a244033015a954f54ca41b90fc2da 100644 (file)
@@ -532,14 +532,11 @@ set g_balance_tuba_animtime 0.05
 set g_balance_tuba_attenuation 0.5
 set g_balance_tuba_damage 5
 set g_balance_tuba_edgedamage 0
-set g_balance_tuba_fadetime 0.25
 set g_balance_tuba_force 40
-set g_balance_tuba_pitchstep 6
 set g_balance_tuba_radius 200
 set g_balance_tuba_refire 0.05
 set g_balance_tuba_switchdelay_drop 0
 set g_balance_tuba_switchdelay_raise 0
-set g_balance_tuba_volume 1
 set g_balance_tuba_weaponreplace ""
 set g_balance_tuba_weaponstart 0
 set g_balance_tuba_weaponstartoverride -1
index 89a6620a33f8e151e7e2afc010321811cd83fcab..f5eff6dfbdb77f724a7d2f63a42ad34671dd546a 100644 (file)
@@ -532,14 +532,11 @@ set g_balance_tuba_animtime 0.05
 set g_balance_tuba_attenuation 0.5
 set g_balance_tuba_damage 5
 set g_balance_tuba_edgedamage 0
-set g_balance_tuba_fadetime 0.25
 set g_balance_tuba_force 40
-set g_balance_tuba_pitchstep 6
 set g_balance_tuba_radius 200
 set g_balance_tuba_refire 0.05
 set g_balance_tuba_switchdelay_drop 0.2
 set g_balance_tuba_switchdelay_raise 0.2
-set g_balance_tuba_volume 1
 set g_balance_tuba_weaponreplace ""
 set g_balance_tuba_weaponstart 0
 set g_balance_tuba_weaponstartoverride -1
index d19d54415bb028bb5123fed143ef221a234d60d9..46d5eab17f1c66ae90c64b6e1de417415cb313db 100644 (file)
@@ -181,14 +181,15 @@ const .float reloading_time = reload_time;
                W_PROP_PRI(class, fld, T, wepname) \
                W_PROP_SEC(class, fld, T, wepname)
        #define W_PROP_BEGIN(class)
-               #ifdef GAMEQC
+               #if defined(SVQC)
                        #define _W_PROP(class, fld, T, wepname) \
                                /* static */ T _W_PROP_CVAR(wepname, fld); \
                                ATTRIB(class, wepvar_##fld, T, _W_PROP_CVAR(wepname, fld));
                        #define _W_PROP_CVAR(wepname, fld) autocvar_g_balance_##wepname##_##fld
+               #elif defined(CSQC)
+                       #define _W_PROP(class, fld, T, wepname) ATTRIB(class, wepvar_##fld, T);
                #else
                        #define _W_PROP(class, fld, T, wepname)
-                       #define _W_PROP_CVAR(wepname, fld)
                #endif
        #define W_PROP_END()
 
index 53e4818514a5ba6414e64e6d629a5c84716b44ee..ac77842f8ea98f8189fdf9ab80fa1be1964d1152 100644 (file)
@@ -299,7 +299,7 @@ void W_Tuba_NoteOn(entity actor, .entity weaponentity, float hittype)
 
        actor.(weaponentity).tuba_note.teleport_time = time + WEP_CVAR(WEP_TUBA, refire) * 2 * W_WeaponRateFactor(actor); // so it can get prolonged safely
 
-       //sound(actor, c, TUBA_NOTE(n), bound(0, VOL_BASE * cvar("g_balance_tuba_volume"), 1), autocvar_g_balance_tuba_attenuation);
+       //sound(actor, c, TUBA_NOTE(n), bound(0, VOL_BASE * autocvar_cl_tuba_volume, 1), autocvar_cl_tuba_attenuation);
        RadiusDamage(actor, actor, WEP_CVAR(WEP_TUBA, damage), WEP_CVAR(WEP_TUBA, edgedamage), WEP_CVAR(WEP_TUBA, radius), NULL, NULL, WEP_CVAR(WEP_TUBA, force), hittype | WEP_TUBA.m_id, weaponentity, NULL);
 
        if(time > actor.(weaponentity).tuba_smoketime)
@@ -476,21 +476,21 @@ void tubasound(entity e, bool restart)
                        snd1 = TUBA_STARTNOTE(e.tuba_instrument, e.note);
                }
 
-               sound7(e, CH_TUBA_SINGLE, snd1, e.tuba_volume * vol1, e.tuba_attenuate * autocvar_g_balance_tuba_attenuation, 100 * speed1, 0);
+               sound7(e, CH_TUBA_SINGLE, snd1, e.tuba_volume * vol1, e.tuba_attenuate * autocvar_cl_tuba_attenuation, 100 * speed1, 0);
                if (vol2) {
-                       sound7(e.enemy, CH_TUBA_SINGLE, snd2, e.tuba_volume * vol2, e.tuba_attenuate * autocvar_g_balance_tuba_attenuation, 100 * speed2, 0);
+                       sound7(e.enemy, CH_TUBA_SINGLE, snd2, e.tuba_volume * vol2, e.tuba_attenuate * autocvar_cl_tuba_attenuation, 100 * speed2, 0);
                }
        } else {
                if (restart) {
                        snd1 = TUBA_STARTNOTE(e.tuba_instrument, e.note);
                }
-               _sound(e, CH_TUBA_SINGLE, snd1, e.tuba_volume, e.tuba_attenuate * autocvar_g_balance_tuba_attenuation);
+               _sound(e, CH_TUBA_SINGLE, snd1, e.tuba_volume, e.tuba_attenuate * autocvar_cl_tuba_attenuation);
        }
 }
 
 void Ent_TubaNote_Think(entity this)
 {
-       float f = autocvar_g_balance_tuba_fadetime;
+       float f = autocvar_cl_tuba_fadetime;
        if (f > 0) {
                this.tuba_volume -= frametime * this.tuba_volume_initial / f;
        } else {
@@ -511,7 +511,7 @@ void Ent_TubaNote_Think(entity this)
 
 void Ent_TubaNote_UpdateSound(entity this)
 {
-       this.enemy.tuba_volume = bound(0, VOL_BASE * autocvar_g_balance_tuba_volume, 1);
+       this.enemy.tuba_volume = bound(0, VOL_BASE * autocvar_cl_tuba_volume, 1);
        this.enemy.tuba_volume_initial = this.enemy.tuba_volume;
        this.enemy.note = this.note;
        this.enemy.tuba_instrument = this.tuba_instrument;
@@ -576,7 +576,7 @@ NET_HANDLE(ENT_CLIENT_TUBANOTE, bool isNew)
 
 PRECACHE(Tuba)
 {
-       Tuba_PitchStep = autocvar_g_balance_tuba_pitchstep;
+       Tuba_PitchStep = autocvar_cl_tuba_pitchstep;
        if (Tuba_PitchStep) {
                if (!checkextension("DP_SND_SOUND7_WIP2") && !checkextension("DP_SND_SOUND7")) {
                        LOG_WARN("requested pitch shifting, but not supported by this engine build");
index ecf4ec5df7429b678f85d2e5daff47922767b3ff..1ca654fbdb45125fc03478c1abc2ad71fb96a06f 100644 (file)
@@ -10,6 +10,13 @@ MODEL(KLEINBOTTLE_VIEW, W_Model("h_kleinbottle.iqm"));
 MODEL(KLEINBOTTLE_WORLD, W_Model("v_kleinbottle.md3"));
 #endif
 
+#ifdef CSQC
+float autocvar_cl_tuba_attenuation = 0.5;
+float autocvar_cl_tuba_fadetime = 0.25;
+float autocvar_cl_tuba_pitchstep = 6;
+float autocvar_cl_tuba_volume = 1;
+#endif
+
 CLASS(Tuba, Weapon)
 /* spawnfunc */ ATTRIB(Tuba, m_canonical_spawnfunc, string, "weapon_tuba");
 /* impulse   */ ATTRIB(Tuba, impulse, int, 1);
@@ -33,14 +40,11 @@ CLASS(Tuba, Weapon)
                P(class, prefix, attenuation, float, NONE) \
                P(class, prefix, damage, float, NONE) \
                P(class, prefix, edgedamage, float, NONE) \
-               P(class, prefix, fadetime, float, NONE) \
                P(class, prefix, force, float, NONE) \
-               P(class, prefix, pitchstep, float, NONE) \
                P(class, prefix, radius, float, NONE) \
                P(class, prefix, refire, float, NONE) \
                P(class, prefix, switchdelay_drop, float, NONE) \
                P(class, prefix, switchdelay_raise, float, NONE) \
-               P(class, prefix, volume, float, NONE) \
                P(class, prefix, weaponreplace, string, NONE) \
                P(class, prefix, weaponstartoverride, float, NONE) \
                P(class, prefix, weaponstart, float, NONE) \
index 5fe4d73c6db19f19c41024a308d2d3bb46937f00..e63690feba4cd5894dfbc22b237a8ebd1326f74b 100644 (file)
@@ -335,6 +335,12 @@ r_glsl_offsetmapping_scale 0.02
 scr_screenshot_jpeg 1
 scr_screenshot_jpeg_quality 0.9
 
+
+seta cl_tuba_attenuation 0.5
+seta cl_tuba_fadetime 0.25
+seta cl_tuba_pitchstep 6
+seta cl_tuba_volume 1
+
 cl_sound_wizardhit ""
 cl_sound_hknighthit ""
 cl_sound_tink1 weapons/tink1.wav