float w_issilent, w_random;
vector w_org, w_backoff;
+float autoswitch;
+bool cvar_cl_allow_uid2name;
+float cvar_cl_autoscreenshot;
+float cvar_cl_autotaunt;
+float cvar_cl_clippedspectating;
+float cvar_cl_handicap;
+float cvar_cl_jetpack_jump;
+float cvar_cl_movement_track_canjump;
+float cvar_cl_noantilag;
+string cvar_cl_physics;
+float cvar_cl_voice_directional;
+float cvar_cl_voice_directional_taunt_attenuation;
+float cvar_cl_weaponimpulsemode;
+string cvar_g_xonoticversion;
+float cvar_cl_cts_noautoswitch;
+bool cvar_cl_weapon_switch_reload;
+bool cvar_cl_weapon_switch_fallback_to_impulse;
+
+REPLICATE(autoswitch, bool, "cl_autoswitch");
+REPLICATE(cvar_cl_allow_uid2name, bool, "cl_allow_uid2name");
+REPLICATE(cvar_cl_autoscreenshot, int, "cl_autoscreenshot");
+REPLICATE(cvar_cl_autotaunt, float, "cl_autotaunt");
+REPLICATE(cvar_cl_clippedspectating, bool, "cl_clippedspectating");
+REPLICATE(cvar_cl_handicap, float, "cl_handicap");
+REPLICATE(cvar_cl_jetpack_jump, bool, "cl_jetpack_jump");
+REPLICATE(cvar_cl_movement_track_canjump, bool, "cl_movement_track_canjump");
+REPLICATE(cvar_cl_noantilag, bool, "cl_noantilag");
+REPLICATE(cvar_cl_physics, string, "cl_physics");
+REPLICATE(cvar_cl_voice_directional, int, "cl_voice_directional");
+REPLICATE(cvar_cl_voice_directional_taunt_attenuation, float, "cl_voice_directional_taunt_attenuation");
+REPLICATE(cvar_cl_weaponimpulsemode, int, "cl_weaponimpulsemode");
+REPLICATE(cvar_g_xonoticversion, string, "g_xonoticversion");
+REPLICATE(cvar_cl_cts_noautoswitch, bool, "cl_cts_noautoswitch");
+REPLICATE(cvar_cl_weapon_switch_reload, bool, "cl_weapon_switch_reload");
+REPLICATE(cvar_cl_weapon_switch_fallback_to_impulse, bool, "cl_weapon_switch_fallback_to_impulse");
+/*
+// this is also a STAT
+// pointless sending this cvars since server can't change gun alignment during the match
+int cvar_cl_gunalign;
+REPLICATE(cvar_cl_gunalign, int, "cl_gunalign");
+
+// cvar cl_newusekeysupported doesn't exist
+float cvar_cl_newusekeysupported;
+REPLICATE(cvar_cl_newusekeysupported, bool, "cl_newusekeysupported");
+*/
+string cvar_cl_allow_uidtracking;
+REPLICATE(cvar_cl_allow_uidtracking, string, "cl_allow_uidtracking");
+
+string cvar_cl_weaponpriority;
+REPLICATE(cvar_cl_weaponpriority, string, "cl_weaponpriority");
+
+string cvar_cl_weaponpriorities[10];
+REPLICATE(cvar_cl_weaponpriorities[0], string, "cl_weaponpriority0");
+REPLICATE(cvar_cl_weaponpriorities[1], string, "cl_weaponpriority1");
+REPLICATE(cvar_cl_weaponpriorities[2], string, "cl_weaponpriority2");
+REPLICATE(cvar_cl_weaponpriorities[3], string, "cl_weaponpriority3");
+REPLICATE(cvar_cl_weaponpriorities[4], string, "cl_weaponpriority4");
+REPLICATE(cvar_cl_weaponpriorities[5], string, "cl_weaponpriority5");
+REPLICATE(cvar_cl_weaponpriorities[6], string, "cl_weaponpriority6");
+REPLICATE(cvar_cl_weaponpriorities[7], string, "cl_weaponpriority7");
+REPLICATE(cvar_cl_weaponpriorities[8], string, "cl_weaponpriority8");
+REPLICATE(cvar_cl_weaponpriorities[9], string, "cl_weaponpriority9");
+
+.int cvar_value;
+void ReplicateVars(bool would_destroy)
+{
+ FOREACH(Notifications, it.nent_type == MSG_CHOICE, {
+ string cvarname = sprintf("notification_%s", Get_Notif_CvarName(it));
+ REPLICATE_SIMPLE(it.cvar_value, cvarname);
+ });
+}
+
float bgmtime;
string weaponorder_byimpulse;
deactivate_minigame();
HUD_MinigameMenu_Close(NULL, NULL, NULL);
+
+ ReplicateVars(true); // destroy
}
.float has_team;
float prev_myteam;
int lasthud;
float vh_notice_time;
+float ReplicateVars_time;
void CSQC_UpdateView(entity this, float w, float h)
{
TC(int, w); TC(int, h);
lasthud = hud;
+ // TODO maybe don't send cvar values until the menu is open
+ // TODO remove CheckSendCvars from menu code (it seems broken anyway)
+ // TODO remove references to sendcvar from cvar descriptions
+ // TODO stop server from requesting cvar values to the client on connection as it's no longer necessary
+
+ if (time > ReplicateVars_time) // prevents network spam
+ {
+ ReplicateVars(false);
+ ReplicateVars_time = time + 0.8 + random() * 0.4;
+ }
+
HUD_Scale_Disable();
if(autocvar__hud_showbinds_reload) // menu can set this one
REGISTER_NET_TEMP(casings)
-#ifdef SVQC
-
+#if defined(SVQC)
.bool cvar_cl_casings;
+#elif defined(CSQC)
+bool cvar_cl_casings;
+#endif
REPLICATE(cvar_cl_casings, bool, "cl_casings");
+#ifdef SVQC
void SpawnCasing(vector vel, float randomvel, vector ang, vector avel, float randomavel, int casingtype, entity casingowner, .entity weaponentity)
{
if (!(CS(casingowner).cvar_cl_casings))
#pragma once
#include "buffs.qh"
+
+float cvar_cl_buffs_autoreplace;
+REPLICATE(cvar_cl_buffs_autoreplace, bool, "cl_buffs_autoreplace");
// generated file; do not modify
+#ifdef CSQC
+ #include <common/mutators/mutator/dodging/cl_dodging.qc>
+#endif
#ifdef SVQC
#include <common/mutators/mutator/dodging/sv_dodging.qc>
#endif
// generated file; do not modify
+#ifdef CSQC
+ #include <common/mutators/mutator/dodging/cl_dodging.qh>
+#endif
#ifdef SVQC
#include <common/mutators/mutator/dodging/sv_dodging.qh>
#endif
--- /dev/null
+#include "cl_dodging.qh"
--- /dev/null
+#pragma once
+
+float cvar_cl_dodging_timeout;
+REPLICATE(cvar_cl_dodging_timeout, float, "cl_dodging_timeout");
#endif
#ifdef CSQC
+ float cvar_cl_dodging_timeout;
#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
#elif defined(SVQC)
+ .float cvar_cl_dodging_timeout;
#define PHYS_DODGING_FRAMETIME sys_frametime
#define PHYS_DODGING_TIMEOUT(s) CS(s).cvar_cl_dodging_timeout
#define PHYS_DODGING_PRESSED_KEYS(s) CS(s).pressedkeys
#include <common/animdecide.qh>
#include <common/physics/player.qh>
-.float cvar_cl_dodging_timeout;
-
REGISTER_MUTATOR(dodging, cvar("g_dodging"))
{
// this just turns on the cvar.
.bool multijump_ready;
#ifdef CSQC
+bool cvar_cl_multijump;
bool autocvar_cl_multijump = true;
#define PHYS_MULTIJUMP_CLIENT(s) autocvar_cl_multijump
}
}
-#ifdef SVQC
-
REPLICATE(cvar_cl_multijump, bool, "cl_multijump");
+#ifdef SVQC
+
MUTATOR_HOOKFUNCTION(multijump, BuildMutatorsString)
{
M_ARGV(0, string) = strcat(M_ARGV(0, string), ":multijump");
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)
{
switch (proj)
STAT(VEIL_ORB_ALPHA, client) = STAT(VEIL_ORB_ALPHA, spectatee);
}
-REPLICATE(cvar_cl_nade_type, int, "cl_nade_type");
-REPLICATE(cvar_cl_pokenade_type, string, "cl_pokenade_type");
-
MUTATOR_HOOKFUNCTION(nades, BuildMutatorsString)
{
M_ARGV(0, string) = strcat(M_ARGV(0, string), ":Nades");
#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
// generated file; do not modify
+#ifdef CSQC
+ #include <common/mutators/mutator/spawn_near_teammate/cl_spawn_near_teammate.qc>
+#endif
#ifdef SVQC
#include <common/mutators/mutator/spawn_near_teammate/sv_spawn_near_teammate.qc>
#endif
// generated file; do not modify
+#ifdef CSQC
+ #include <common/mutators/mutator/spawn_near_teammate/cl_spawn_near_teammate.qh>
+#endif
#ifdef SVQC
#include <common/mutators/mutator/spawn_near_teammate/sv_spawn_near_teammate.qh>
#endif
--- /dev/null
+#include "cl_spawn_near_teammate.qh"
--- /dev/null
+#pragma once
+
+float cvar_cl_spawn_near_teammate;
+REPLICATE(cvar_cl_spawn_near_teammate, bool, "cl_spawn_near_teammate");
#endif
#ifdef SVQC
.int cvar_cl_gunalign;
-REPLICATE(cvar_cl_gunalign, int, "cl_gunalign");
#endif
+
REGISTER_STAT(GUNALIGN, int)
#ifdef SVQC
SPECTATE_COPYFIELD(_STAT(GUNALIGN))
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(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
+
#ifdef SVQC
void wframe_send(entity actor, entity weaponentity, vector a, bool restartanim);
#endif
#define REPLICATE(...) EVAL_REPLICATE(OVERLOAD(REPLICATE, __VA_ARGS__))
#define EVAL_REPLICATE(...) __VA_ARGS__
+ #if defined(SVQC)
ACCUMULATE void ReplicateVars(entity this, entity store, string thisname, int i) {}
+ #elif defined(CSQC)
+ ACCUMULATE void ReplicateVars(bool would_destroy) {}
+ #endif
#define REPLICATE_3(fld, type, var) REPLICATE_4(fld, type, var, )
#define REPLICATE_4(fld, type, var, func) REPLICATE_##type(fld, var, func)
- #define REPLICATE_string(fld, var, func) \
- REPLICATE_7(fld, string, var, , \
- { strcpy(field, it); }, \
- { strfree(field); }, \
- { \
- /* also initialize to the default value of func when requesting cvars */ \
- string s = func(field); \
- if (s != field) \
+ #if defined(SVQC)
+ #define REPLICATE_string(fld, var, func) \
+ REPLICATE_7(fld, string, var, , \
+ { strcpy(field, it); }, \
+ { strfree(field); }, \
{ \
- strcpy(field, s); \
- } \
- })
- #define REPLICATE_float(fld, var, func) REPLICATE_7(fld, float, var, func, { field = stof(it); }, , )
- #define REPLICATE_bool(fld, var, func) REPLICATE_7(fld, bool, var, func, { field = boolean(stoi(it)); }, , )
- #define REPLICATE_int(fld, var, func) REPLICATE_7(fld, int, var, func, { field = stoi(it); }, , )
+ /* also initialize to the default value of func when requesting cvars */ \
+ string s = func(field); \
+ if (s != field) \
+ { \
+ strcpy(field, s); \
+ } \
+ })
+ #define REPLICATE_float(fld, var, func) REPLICATE_7(fld, float, var, func, { field = stof(it); }, , )
+ #define REPLICATE_bool(fld, var, func) REPLICATE_7(fld, bool, var, func, { field = boolean(stoi(it)); }, , )
+ #define REPLICATE_int(fld, var, func) REPLICATE_7(fld, int, var, func, { field = stoi(it); }, , )
- #if defined(SVQC)
#define REPLICATE_7(fld, type, var, func, create, destroy, after) \
void ReplicateVars(entity this, entity store, string thisname, int i) \
{ \
} \
else \
{ \
- stuffcmd(this, "cl_cmd sendcvar " var "\n"); \
+ stuffcmd(this, strcat("cl_cmd sendcvar ", var, "\n")); \
} \
if (current) { after } \
} \
store.fld = field; \
}
#elif defined(CSQC)
- // TODO
- #define REPLICATE_7(fld, type, var, func, create, destroy, after)
+ #define REPLICATE_string(fld, var, func) REPLICATE_7(fld, float, var, func, (fld != cvar_string(var)), { strcpy(fld, cvar_string(var)); }, { strfree(fld); })
+ #define REPLICATE_float(fld, var, func) REPLICATE_7(fld, float, var, func, (fld != cvar(var)), { fld = cvar(var); }, )
+ #define REPLICATE_bool(fld, var, func) REPLICATE_7(fld, bool, var, func, (fld != cvar(var)), { fld = cvar(var); }, )
+ #define REPLICATE_int(fld, var, func) REPLICATE_7(fld, int, var, func, (fld != cvar(var)), { fld = cvar(var); }, )
+
+ #define REPLICATE_7(fld, type, var, func, check, update, destroy) \
+ void ReplicateVars(bool would_destroy) \
+ { \
+ if (would_destroy > 0) { destroy } \
+ else if (check) \
+ { \
+ localcmd(strcat("cl_cmd sendcvar ", var, "\n")); \
+ update \
+ } \
+ }
+
+ #define REPLICATE_SIMPLE(field, cvarname) MACRO_BEGIN \
+ if (field != cvar(cvarname)) \
+ { \
+ localcmd(strcat("cl_cmd sendcvar ", cvarname, "\n")); \
+ field = cvar(cvarname); \
+ } \
+ MACRO_END
#endif
#endif