]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Use REPLICATE_FIELD for the all replicated cvars
authorterencehill <piuntn@gmail.com>
Sat, 8 Jan 2022 21:24:17 +0000 (22:24 +0100)
committerterencehill <piuntn@gmail.com>
Sat, 8 Jan 2022 21:24:17 +0000 (22:24 +0100)
15 files changed:
qcsrc/common/effects/qc/casings.qc
qcsrc/common/mutators/mutator/buffs/buffs.qh
qcsrc/common/mutators/mutator/buffs/cl_buffs.qh
qcsrc/common/mutators/mutator/buffs/sv_buffs.qc
qcsrc/common/mutators/mutator/buffs/sv_buffs.qh
qcsrc/common/mutators/mutator/dodging/sv_dodging.qc
qcsrc/common/mutators/mutator/multijump/multijump.qc
qcsrc/common/mutators/mutator/multijump/multijump.qh
qcsrc/common/mutators/mutator/nades/nades.qc
qcsrc/common/mutators/mutator/nades/nades.qh
qcsrc/common/mutators/mutator/spawn_near_teammate/cl_spawn_near_teammate.qh
qcsrc/common/mutators/mutator/spawn_near_teammate/spawn_near_teammate.qh
qcsrc/common/mutators/mutator/spawn_near_teammate/sv_spawn_near_teammate.qc
qcsrc/common/weapons/all.qh
qcsrc/server/weapons/accuracy.qh

index 10dfa385d450fb5736c01935da463051fefb2f3c..ba83821f7af297d81a80ef8b12742eaa9ae53a70 100644 (file)
 
 REGISTER_NET_TEMP(casings)
 
-#if defined(SVQC)
-.bool cvar_cl_casings;
-.int cvar_r_drawviewmodel;
-#elif defined(CSQC)
-bool cvar_cl_casings;
-int cvar_r_drawviewmodel;
-#endif
+
+REPLICATE_FIELD(bool, cvar_cl_casings);
+REPLICATE_FIELD(int, cvar_r_drawviewmodel);
 REPLICATE(cvar_cl_casings, bool, "cl_casings");
 REPLICATE(cvar_r_drawviewmodel, int, "r_drawviewmodel");
 
index f4fad84de7fa7f96404a8611cd93c51b67f13a58..44fe0f123dc0a86f8fae4902d85a83c43e0d70da 100644 (file)
@@ -72,3 +72,8 @@ string Buff_UndeprecateName(string buffname);
 BUFF_SPAWNFUNCS(random, NULL)
 
 #include "all.inc"
+
+#ifdef GAMEQC
+REPLICATE_FIELD(bool, cvar_cl_buffs_autoreplace);
+REPLICATE(cvar_cl_buffs_autoreplace, bool, "cl_buffs_autoreplace");
+#endif
index c9dbe5add1674f004a82bff50a180f9649172c1d..c93902291da2383ca99ee6cabda85463009ac3b3 100644 (file)
@@ -1,6 +1,3 @@
 #pragma once
 
 #include "buffs.qh"
-
-float cvar_cl_buffs_autoreplace;
-REPLICATE(cvar_cl_buffs_autoreplace, bool, "cl_buffs_autoreplace");
index 7b85e73841fab07f2063e676e6447531ed948881..6ce016e5681046730193233a5c281c1b7a835165 100644 (file)
@@ -969,8 +969,6 @@ MUTATOR_HOOKFUNCTION(buffs, PlayerRegen)
        }
 }
 
-REPLICATE(cvar_cl_buffs_autoreplace, bool, "cl_buffs_autoreplace");
-
 MUTATOR_HOOKFUNCTION(buffs, BuildMutatorsString)
 {
        if(autocvar_g_buffs > 0) // only report as a mutator if they're enabled
index 7635df6b64eab1510011481e35042e1cbcb8f460..c8b2b363d12e6e704b214036e6cf33b44cfc0c09 100644 (file)
@@ -77,9 +77,6 @@ float autocvar_g_buffs_luck_damagemultiplier = 3;
 const vector BUFF_MIN = ('-16 -16 0');
 const vector BUFF_MAX = ('16 16 60');
 
-// client side options
-.float cvar_cl_buffs_autoreplace;
-
 float buff_Available(entity buff);
 
 void buff_RemoveAll(entity actor, int removal_type);
index 53effbae20c20c89822b6f499e816998be992810..956b544841d6b06d78c5e1f775173a7c5ce1ba68 100644 (file)
 #endif
 
 #ifdef CSQC
-       float cvar_cl_dodging_timeout;
-       bool cvar_cl_dodging;
        bool autocvar_cl_dodging;
        #define PHYS_DODGING_FRAMETIME                          (1 / (frametime <= 0 ? 60 : frametime))
        #define PHYS_DODGING_TIMEOUT(s)                         STAT(DODGING_TIMEOUT)
        #define PHYS_DODGING_PRESSED_KEYS(s)            (s).pressedkeys
        #define PHYS_DODGING_ENABLED(s)                         autocvar_cl_dodging
 #elif defined(SVQC)
-       .float cvar_cl_dodging_timeout;
-       .bool cvar_cl_dodging;
        #define PHYS_DODGING_FRAMETIME                          sys_frametime
        #define PHYS_DODGING_TIMEOUT(s)                         CS_CVAR(s).cvar_cl_dodging_timeout
        #define PHYS_DODGING_PRESSED_KEYS(s)            CS(s).pressedkeys
        #define PHYS_DODGING_ENABLED(s)                         CS_CVAR(s).cvar_cl_dodging
 #endif
 
+REPLICATE_FIELD(bool, cvar_cl_dodging);
+REPLICATE_FIELD(float, cvar_cl_dodging_timeout);
+REPLICATE(cvar_cl_dodging_timeout, float, "cl_dodging_timeout");
+REPLICATE(cvar_cl_dodging, bool, "cl_dodging");
+
 #ifdef SVQC
 
 bool autocvar_sv_dodging_sound;
@@ -307,9 +308,6 @@ MUTATOR_HOOKFUNCTION(dodging, PlayerPhysics)
 
 #ifdef SVQC
 
-REPLICATE(cvar_cl_dodging_timeout, float, "cl_dodging_timeout");
-REPLICATE(cvar_cl_dodging, bool, "cl_dodging");
-
 void dodging_ResetPlayer(entity this)
 {
        this.last_dodging_time = 0;
index 9642ab0b38c6bc82ba8495fa87f1df8a2bca0a33..5c7838b36b28ee2d34c996e90f2ba3fa4337113e 100644 (file)
@@ -25,13 +25,9 @@ REGISTER_MUTATOR(multijump, true);
 .bool multijump_ready;
 
 #ifdef CSQC
-int cvar_cl_multijump;
 int autocvar_cl_multijump = -1;
-
        #define PHYS_MULTIJUMP_CLIENT(s)        autocvar_cl_multijump
 #elif defined(SVQC)
-.int cvar_cl_multijump;
-
        #define PHYS_MULTIJUMP_CLIENT(s)        CS_CVAR(s).cvar_cl_multijump
 #endif
 
@@ -118,8 +114,6 @@ MUTATOR_HOOKFUNCTION(multijump, PlayerJump)
        }
 }
 
-REPLICATE(cvar_cl_multijump, int, "cl_multijump");
-
 #ifdef SVQC
 
 MUTATOR_HOOKFUNCTION(multijump, BuildMutatorsString)
index 6f70f09beec2219624baeca92e2cd7deaa104fb4..2d2dc015ab823f21f19a3d3d9d9206a2ab7f66e2 100644 (file)
@@ -1 +1,6 @@
 #pragma once
+
+#ifdef GAMEQC
+REPLICATE_FIELD(int, cvar_cl_multijump);
+REPLICATE(cvar_cl_multijump, bool, "cl_multijump");
+#endif
index 04c61a6d73c5e8cf23c135e780372cb892d6a74e..a8eb3b5f693db0bf71564950c574d0e0e3b5e917 100644 (file)
@@ -11,8 +11,6 @@ float autocvar_g_nades_spread = 0.04;
 REGISTER_STAT(NADES_SMALL, int, autocvar_g_nades_nade_small)
 
 #ifdef GAMEQC
-REPLICATE(cvar_cl_nade_type, int, "cl_nade_type");
-REPLICATE(cvar_cl_pokenade_type, string, "cl_pokenade_type");
 
 entity Nade_TrailEffect(int proj, int nade_team)
 {
index c07882270163a4434ad1ca4e1db3a6b5a2b40cbb..791c18b4b15953bca9324a10aac12c04202d18ac 100644 (file)
@@ -129,6 +129,13 @@ Nade Nade_FromProjectile(int proj)
 .float orb_lifetime;
 .float orb_radius;
 
+#ifdef GAMEQC
+REPLICATE_FIELD(int, cvar_cl_nade_type);
+REPLICATE_FIELD(string, cvar_cl_pokenade_type);
+REPLICATE(cvar_cl_nade_type, int, "cl_nade_type");
+REPLICATE(cvar_cl_pokenade_type, string, "cl_pokenade_type");
+#endif
+
 #ifdef SVQC
 
 .entity nade;
@@ -137,8 +144,6 @@ Nade Nade_FromProjectile(int proj)
 .float nade_special_time;
 .string pokenade_type;
 .entity nade_damage_target;
-.float cvar_cl_nade_type;
-.string cvar_cl_pokenade_type;
 .float toss_time;
 .float nade_show_particles;
 .float nade_veil_prevalpha;
@@ -167,8 +172,6 @@ MUTATOR_HOOKABLE(Nade_Damage, EV_Nade_Damage);
 #endif
 
 #ifdef CSQC
-float cvar_cl_nade_type;
-string cvar_cl_pokenade_type;
 bool Projectile_isnade(int proj); // TODO: remove
 
 void DrawAmmoNades(vector myPos, vector mySize, bool draw_expanding, float expand_time); // TODO: mutator
index 640a7255f198b931f7afbdc4197328c46496067d..6f70f09beec2219624baeca92e2cd7deaa104fb4 100644 (file)
@@ -1,4 +1 @@
 #pragma once
-
-float cvar_cl_spawn_near_teammate;
-REPLICATE(cvar_cl_spawn_near_teammate, bool, "cl_spawn_near_teammate");
index 3f59c932d39b02caf58f2abac65bdd9246f0a7da..6b08873ba71ba559b820fbe75e7dc5038c5b5427 100644 (file)
@@ -1,2 +1,6 @@
 #pragma once
 
+#ifdef GAMEQC
+REPLICATE_FIELD(bool, cvar_cl_spawn_near_teammate);
+REPLICATE(cvar_cl_spawn_near_teammate, bool, "cl_spawn_near_teammate");
+#endif
index 2f0c794317b15ccbe8c41f85a90381c37208022e..c2a3250d8062ed47988623e92de6b8e707690e6b 100644 (file)
@@ -19,8 +19,6 @@ REGISTER_MUTATOR(spawn_near_teammate, expr_evaluate(autocvar_g_spawn_near_teamma
 
 .float msnt_timer;
 
-.float cvar_cl_spawn_near_teammate;
-
 MUTATOR_HOOKFUNCTION(spawn_near_teammate, Spawn_Score)
 {
        if (!teamplay) return;
@@ -228,5 +226,3 @@ LABEL(skip)
                */
        }
 }
-
-REPLICATE(cvar_cl_spawn_near_teammate, bool, "cl_spawn_near_teammate");
index cde5d56b3739f4b66efb88e123cac99d5a69d01e..d2c8c09e84518097100441e96207275530d74d9a 100644 (file)
@@ -395,9 +395,9 @@ vector shotorg_adjust_values(vector vecs, bool y_is_right, bool visual, int algn
 void CL_WeaponEntity_SetModel(entity this, string name, bool _anim);
 
 #ifdef CSQC
-bool cvar_cl_accuracy_data_share;
+REPLICATE_FIELD(bool, cvar_cl_accuracy_data_share);
+REPLICATE_FIELD(bool, cvar_cl_accuracy_data_receive);
 REPLICATE(cvar_cl_accuracy_data_share, bool, "cl_accuracy_data_share");
-bool cvar_cl_accuracy_data_receive;
 REPLICATE(cvar_cl_accuracy_data_receive, bool, "cl_accuracy_data_receive");
 #endif
 
index 81d2b1763bfe4c8e9f82b408cf61be22c60ee314..b1375b5a0a547ed461c41be8f8399fff156d524c 100644 (file)
@@ -20,9 +20,9 @@
 
 float autocvar_sv_accuracy_data_share = 1;
 
-.bool cvar_cl_accuracy_data_share;
+REPLICATE_FIELD(bool, cvar_cl_accuracy_data_share);
+REPLICATE_FIELD(bool, cvar_cl_accuracy_data_receive);
 REPLICATE(cvar_cl_accuracy_data_share, bool, "cl_accuracy_data_share");
-.bool cvar_cl_accuracy_data_receive;
 REPLICATE(cvar_cl_accuracy_data_receive, bool, "cl_accuracy_data_receive");
 
 .entity accuracy;