From: terencehill Date: Tue, 11 Jan 2022 00:05:31 +0000 (+0100) Subject: Move more REPLICATE calls to \common and from qh files to qc files (it fixes compilat... X-Git-Tag: xonotic-v0.8.5~204^2~3 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=689d7266afa20762289c3f3ef13f50c1ab9ea017;p=xonotic%2Fxonotic-data.pk3dir.git Move more REPLICATE calls to \common and from qh files to qc files (it fixes compilation units) --- diff --git a/qcsrc/common/effects/qc/casings.qc b/qcsrc/common/effects/qc/casings.qc index ba83821f7..c0c7f5ac9 100644 --- a/qcsrc/common/effects/qc/casings.qc +++ b/qcsrc/common/effects/qc/casings.qc @@ -10,9 +10,6 @@ REGISTER_NET_TEMP(casings) - -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"); diff --git a/qcsrc/common/effects/qc/casings.qh b/qcsrc/common/effects/qc/casings.qh index 25f1087e4..f43e15a1c 100644 --- a/qcsrc/common/effects/qc/casings.qh +++ b/qcsrc/common/effects/qc/casings.qh @@ -8,6 +8,11 @@ bool autocvar_cl_casings_sloppy = 1; float autocvar_cl_casings_ticrate = 0.1; #endif +#ifdef GAMEQC +REPLICATE_FIELD(bool, cvar_cl_casings); +REPLICATE_FIELD(int, cvar_r_drawviewmodel); +#endif + #ifdef SVQC int autocvar_g_casings; diff --git a/qcsrc/common/effects/qc/globalsound.qc b/qcsrc/common/effects/qc/globalsound.qc index 43a489105..f5eaf11cd 100644 --- a/qcsrc/common/effects/qc/globalsound.qc +++ b/qcsrc/common/effects/qc/globalsound.qc @@ -7,6 +7,12 @@ REGISTER_NET_TEMP(globalsound) REGISTER_NET_TEMP(playersound) + #ifdef GAMEQC + REPLICATE(cvar_cl_autotaunt, float, "cl_autotaunt"); + REPLICATE(cvar_cl_voice_directional, int, "cl_voice_directional"); + REPLICATE(cvar_cl_voice_directional_taunt_attenuation, float, "cl_voice_directional_taunt_attenuation"); + #endif + #ifdef SVQC /** * @param from the source entity, its position is sent diff --git a/qcsrc/common/effects/qc/globalsound.qh b/qcsrc/common/effects/qc/globalsound.qh index 91eae388c..d9a7eac30 100644 --- a/qcsrc/common/effects/qc/globalsound.qh +++ b/qcsrc/common/effects/qc/globalsound.qh @@ -16,10 +16,9 @@ .string m_playersoundstr; ..string m_playersoundfld; +REPLICATE_FIELD(float, cvar_cl_autotaunt); REPLICATE_FIELD(int, cvar_cl_voice_directional); REPLICATE_FIELD(float, cvar_cl_voice_directional_taunt_attenuation); -REPLICATE(cvar_cl_voice_directional, int, "cl_voice_directional"); -REPLICATE(cvar_cl_voice_directional_taunt_attenuation, float, "cl_voice_directional_taunt_attenuation"); REGISTRY(PlayerSounds, BITS(8) - 1) #define REGISTER_PLAYERSOUND(id) \ diff --git a/qcsrc/common/mutators/mutator/buffs/buffs.qc b/qcsrc/common/mutators/mutator/buffs/buffs.qc index 15cc19960..ce51e4fa4 100644 --- a/qcsrc/common/mutators/mutator/buffs/buffs.qc +++ b/qcsrc/common/mutators/mutator/buffs/buffs.qc @@ -5,3 +5,7 @@ string BUFF_NAME(int i) Buff b = REGISTRY_GET(StatusEffect, i); return strcat(rgb_to_hexcolor(b.m_color), b.m_name); } + +#ifdef GAMEQC +REPLICATE(cvar_cl_buffs_autoreplace, bool, "cl_buffs_autoreplace"); +#endif diff --git a/qcsrc/common/mutators/mutator/buffs/buffs.qh b/qcsrc/common/mutators/mutator/buffs/buffs.qh index 44fe0f123..b5cd426be 100644 --- a/qcsrc/common/mutators/mutator/buffs/buffs.qh +++ b/qcsrc/common/mutators/mutator/buffs/buffs.qh @@ -75,5 +75,4 @@ BUFF_SPAWNFUNCS(random, NULL) #ifdef GAMEQC REPLICATE_FIELD(bool, cvar_cl_buffs_autoreplace); -REPLICATE(cvar_cl_buffs_autoreplace, bool, "cl_buffs_autoreplace"); #endif diff --git a/qcsrc/common/mutators/mutator/dodging/cl_dodging.qc b/qcsrc/common/mutators/mutator/dodging/cl_dodging.qc index a9d10efa7..237ff0e9f 100644 --- a/qcsrc/common/mutators/mutator/dodging/cl_dodging.qc +++ b/qcsrc/common/mutators/mutator/dodging/cl_dodging.qc @@ -1 +1,4 @@ #include "cl_dodging.qh" + +REPLICATE(cvar_cl_dodging_timeout, float, "cl_dodging_timeout"); +REPLICATE(cvar_cl_dodging, bool, "cl_dodging"); diff --git a/qcsrc/common/mutators/mutator/dodging/cl_dodging.qh b/qcsrc/common/mutators/mutator/dodging/cl_dodging.qh index 696a2d9e5..d7c5a5262 100644 --- a/qcsrc/common/mutators/mutator/dodging/cl_dodging.qh +++ b/qcsrc/common/mutators/mutator/dodging/cl_dodging.qh @@ -1,7 +1,4 @@ #pragma once -float cvar_cl_dodging_timeout; -REPLICATE(cvar_cl_dodging_timeout, float, "cl_dodging_timeout"); - -float cvar_cl_dodging; -REPLICATE(cvar_cl_dodging, float, "cl_dodging"); +REPLICATE_FIELD(float, cvar_cl_dodging_timeout); +REPLICATE_FIELD(bool, cvar_cl_dodging); diff --git a/qcsrc/common/mutators/mutator/dodging/sv_dodging.qc b/qcsrc/common/mutators/mutator/dodging/sv_dodging.qc index 956b54484..8af509222 100644 --- a/qcsrc/common/mutators/mutator/dodging/sv_dodging.qc +++ b/qcsrc/common/mutators/mutator/dodging/sv_dodging.qc @@ -54,8 +54,6 @@ #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"); diff --git a/qcsrc/common/mutators/mutator/dodging/sv_dodging.qh b/qcsrc/common/mutators/mutator/dodging/sv_dodging.qh index 6f70f09be..e04c2ffbc 100644 --- a/qcsrc/common/mutators/mutator/dodging/sv_dodging.qh +++ b/qcsrc/common/mutators/mutator/dodging/sv_dodging.qh @@ -1 +1,4 @@ #pragma once + +REPLICATE_FIELD(bool, cvar_cl_dodging); +REPLICATE_FIELD(float, cvar_cl_dodging_timeout); diff --git a/qcsrc/common/mutators/mutator/multijump/multijump.qc b/qcsrc/common/mutators/mutator/multijump/multijump.qc index 5c7838b36..5f904ecf1 100644 --- a/qcsrc/common/mutators/mutator/multijump/multijump.qc +++ b/qcsrc/common/mutators/mutator/multijump/multijump.qc @@ -2,6 +2,8 @@ #ifdef GAMEQC +REPLICATE(cvar_cl_multijump, bool, "cl_multijump"); + #ifdef SVQC #include #endif diff --git a/qcsrc/common/mutators/mutator/multijump/multijump.qh b/qcsrc/common/mutators/mutator/multijump/multijump.qh index 2d2dc015a..8073b5583 100644 --- a/qcsrc/common/mutators/mutator/multijump/multijump.qh +++ b/qcsrc/common/mutators/mutator/multijump/multijump.qh @@ -2,5 +2,4 @@ #ifdef GAMEQC REPLICATE_FIELD(int, cvar_cl_multijump); -REPLICATE(cvar_cl_multijump, bool, "cl_multijump"); #endif diff --git a/qcsrc/common/mutators/mutator/nades/nades.qc b/qcsrc/common/mutators/mutator/nades/nades.qc index a8eb3b5f6..2869d4f22 100644 --- a/qcsrc/common/mutators/mutator/nades/nades.qc +++ b/qcsrc/common/mutators/mutator/nades/nades.qc @@ -12,6 +12,9 @@ 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) diff --git a/qcsrc/common/mutators/mutator/nades/nades.qh b/qcsrc/common/mutators/mutator/nades/nades.qh index 791c18b4b..957824a77 100644 --- a/qcsrc/common/mutators/mutator/nades/nades.qh +++ b/qcsrc/common/mutators/mutator/nades/nades.qh @@ -132,8 +132,6 @@ Nade Nade_FromProjectile(int proj) #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 diff --git a/qcsrc/common/mutators/mutator/spawn_near_teammate/spawn_near_teammate.qc b/qcsrc/common/mutators/mutator/spawn_near_teammate/spawn_near_teammate.qc index 745374770..218e00ef2 100644 --- a/qcsrc/common/mutators/mutator/spawn_near_teammate/spawn_near_teammate.qc +++ b/qcsrc/common/mutators/mutator/spawn_near_teammate/spawn_near_teammate.qc @@ -1 +1,5 @@ #include "spawn_near_teammate.qh" + +#ifdef GAMEQC +REPLICATE(cvar_cl_spawn_near_teammate, bool, "cl_spawn_near_teammate"); +#endif diff --git a/qcsrc/common/mutators/mutator/spawn_near_teammate/spawn_near_teammate.qh b/qcsrc/common/mutators/mutator/spawn_near_teammate/spawn_near_teammate.qh index 6b08873ba..881df9ed2 100644 --- a/qcsrc/common/mutators/mutator/spawn_near_teammate/spawn_near_teammate.qh +++ b/qcsrc/common/mutators/mutator/spawn_near_teammate/spawn_near_teammate.qh @@ -2,5 +2,4 @@ #ifdef GAMEQC REPLICATE_FIELD(bool, cvar_cl_spawn_near_teammate); -REPLICATE(cvar_cl_spawn_near_teammate, bool, "cl_spawn_near_teammate"); #endif diff --git a/qcsrc/common/physics/player.qc b/qcsrc/common/physics/player.qc index 2b3c51374..75ebfd2ce 100644 --- a/qcsrc/common/physics/player.qc +++ b/qcsrc/common/physics/player.qc @@ -3,6 +3,12 @@ #include #include +#ifdef GAMEQC +REPLICATE(cvar_cl_physics, string, "cl_physics"); +REPLICATE(cvar_cl_jetpack_jump, bool, "cl_jetpack_jump"); +REPLICATE(cvar_cl_movement_track_canjump, bool, "cl_movement_track_canjump"); +#endif + #ifdef SVQC #include #include diff --git a/qcsrc/common/physics/player.qh b/qcsrc/common/physics/player.qh index 4e2b656d8..034393f29 100644 --- a/qcsrc/common/physics/player.qh +++ b/qcsrc/common/physics/player.qh @@ -71,12 +71,11 @@ float AdjustAirAccelQW(float accelqw, float factor); bool IsFlying(entity a); +#ifdef GAMEQC REPLICATE_FIELD(string, cvar_cl_physics); REPLICATE_FIELD(bool, cvar_cl_jetpack_jump); REPLICATE_FIELD(bool, cvar_cl_movement_track_canjump); -REPLICATE(cvar_cl_physics, string, "cl_physics"); -REPLICATE(cvar_cl_jetpack_jump, bool, "cl_jetpack_jump"); -REPLICATE(cvar_cl_movement_track_canjump, bool, "cl_movement_track_canjump"); +#endif #define PHYS_PL_MAX(s) STAT(PL_MAX, s) #define PHYS_PL_MIN(s) STAT(PL_MIN, s) diff --git a/qcsrc/common/playerstats.qc b/qcsrc/common/playerstats.qc index 3d0ca1ee6..ac3c46822 100644 --- a/qcsrc/common/playerstats.qc +++ b/qcsrc/common/playerstats.qc @@ -15,6 +15,17 @@ #include #endif + +#ifdef GAMEQC +REPLICATE(cvar_cl_allow_uid2name, int, "cl_allow_uid2name"); +REPLICATE(cvar_cl_allow_uidranking, bool, "cl_allow_uidranking"); +REPLICATE(cvar_cl_allow_uidtracking, int, "cl_allow_uidtracking"); +#endif + +#ifdef SVQC +REPLICATE_APPLYCHANGE("cl_allow_uidtracking", { PlayerStats_GameReport_AddPlayer(this); }); +#endif + #ifdef SVQC void PlayerStats_Prematch() { diff --git a/qcsrc/common/playerstats.qh b/qcsrc/common/playerstats.qh index 39ffab623..4383ee3eb 100644 --- a/qcsrc/common/playerstats.qh +++ b/qcsrc/common/playerstats.qh @@ -117,4 +117,13 @@ float autocvar_g_playerstats_playerdetail_autoupdatetime = 1800; // automaticall void PlayerStats_PlayerDetail(); void PlayerStats_PlayerDetail_CheckUpdate(); void PlayerStats_PlayerDetail_Handler(entity fh, entity p, float status); + +#endif + +#ifdef GAMEQC + +REPLICATE_FIELD(int, cvar_cl_allow_uid2name); +REPLICATE_FIELD(bool, cvar_cl_allow_uidranking); +REPLICATE_FIELD(int, cvar_cl_allow_uidtracking); + #endif diff --git a/qcsrc/common/replicate.qh b/qcsrc/common/replicate.qh index cd10e5a31..65ceecf1f 100644 --- a/qcsrc/common/replicate.qh +++ b/qcsrc/common/replicate.qh @@ -1,34 +1,18 @@ #pragma once #ifdef GAMEQC -// TODO: merge into REPLICATE REPLICATE_FIELD(bool, cvar_cl_autoswitch); -REPLICATE_FIELD(int, cvar_cl_allow_uid2name); -REPLICATE_FIELD(bool, cvar_cl_allow_uidranking); -REPLICATE_FIELD(int, cvar_cl_allow_uidtracking); REPLICATE_FIELD(int, cvar_cl_autoscreenshot); -REPLICATE_FIELD(float, cvar_cl_autotaunt); REPLICATE_FIELD(bool, cvar_cl_clippedspectating); REPLICATE_FIELD(bool, cvar_cl_cts_noautoswitch); REPLICATE_FIELD(float, cvar_cl_handicap); REPLICATE_FIELD(bool, cvar_cl_noantilag); REPLICATE_FIELD(string, cvar_g_xonoticversion); -#endif - -#ifdef GAMEQC REPLICATE(cvar_cl_autoswitch, bool, "cl_autoswitch"); -REPLICATE(cvar_cl_allow_uid2name, int, "cl_allow_uid2name"); -REPLICATE(cvar_cl_allow_uidranking, bool, "cl_allow_uidranking"); -REPLICATE(cvar_cl_allow_uidtracking, int, "cl_allow_uidtracking"); -#ifdef SVQC -REPLICATE_APPLYCHANGE("cl_allow_uidtracking", { PlayerStats_GameReport_AddPlayer(this); }); -#endif REPLICATE(cvar_cl_autoscreenshot, int, "cl_autoscreenshot"); -REPLICATE(cvar_cl_autotaunt, float, "cl_autotaunt"); REPLICATE(cvar_cl_clippedspectating, bool, "cl_clippedspectating"); REPLICATE(cvar_cl_cts_noautoswitch, bool, "cl_cts_noautoswitch"); REPLICATE(cvar_cl_handicap, float, "cl_handicap"); REPLICATE(cvar_cl_noantilag, bool, "cl_noantilag"); REPLICATE(cvar_g_xonoticversion, string, "g_xonoticversion"); - #endif diff --git a/qcsrc/common/weapons/all.qc b/qcsrc/common/weapons/all.qc index f44668061..00e71e0de 100644 --- a/qcsrc/common/weapons/all.qc +++ b/qcsrc/common/weapons/all.qc @@ -835,3 +835,26 @@ string W_FixWeaponOrder_ForceComplete_AndBuildImpulseList(entity this, string wo return o; } #endif + +#ifdef CSQC +REPLICATE(cvar_cl_accuracy_data_share, bool, "cl_accuracy_data_share"); +REPLICATE(cvar_cl_accuracy_data_receive, bool, "cl_accuracy_data_receive"); +#endif + +#ifdef GAMEQC +REPLICATE(cvar_cl_gunalign, int, "cl_gunalign"); +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"); +REPLICATE(cvar_cl_weaponimpulsemode, int, "cl_weaponimpulsemode"); +REPLICATE(cvar_cl_weaponpriority, string, "cl_weaponpriority", W_FixWeaponOrder_ForceComplete_AndBuildImpulseList); +REPLICATE(cvar_cl_weaponpriorities[0], string, "cl_weaponpriority0", W_FixWeaponOrder_AllowIncomplete); +REPLICATE(cvar_cl_weaponpriorities[1], string, "cl_weaponpriority1", W_FixWeaponOrder_AllowIncomplete); +REPLICATE(cvar_cl_weaponpriorities[2], string, "cl_weaponpriority2", W_FixWeaponOrder_AllowIncomplete); +REPLICATE(cvar_cl_weaponpriorities[3], string, "cl_weaponpriority3", W_FixWeaponOrder_AllowIncomplete); +REPLICATE(cvar_cl_weaponpriorities[4], string, "cl_weaponpriority4", W_FixWeaponOrder_AllowIncomplete); +REPLICATE(cvar_cl_weaponpriorities[5], string, "cl_weaponpriority5", W_FixWeaponOrder_AllowIncomplete); +REPLICATE(cvar_cl_weaponpriorities[6], string, "cl_weaponpriority6", W_FixWeaponOrder_AllowIncomplete); +REPLICATE(cvar_cl_weaponpriorities[7], string, "cl_weaponpriority7", W_FixWeaponOrder_AllowIncomplete); +REPLICATE(cvar_cl_weaponpriorities[8], string, "cl_weaponpriority8", W_FixWeaponOrder_AllowIncomplete); +REPLICATE(cvar_cl_weaponpriorities[9], string, "cl_weaponpriority9", W_FixWeaponOrder_AllowIncomplete); +#endif diff --git a/qcsrc/common/weapons/all.qh b/qcsrc/common/weapons/all.qh index d2c8c09e8..08d185e31 100644 --- a/qcsrc/common/weapons/all.qh +++ b/qcsrc/common/weapons/all.qh @@ -394,11 +394,17 @@ ENUMCLASS_END(WFRAME) vector shotorg_adjust_values(vector vecs, bool y_is_right, bool visual, int algn); void CL_WeaponEntity_SetModel(entity this, string name, bool _anim); +REPLICATE_FIELD(int, cvar_cl_gunalign); +REPLICATE_FIELD(bool, cvar_cl_weapon_switch_reload); +REPLICATE_FIELD(bool, cvar_cl_weapon_switch_fallback_to_impulse); +REPLICATE_FIELD(int, cvar_cl_weaponimpulsemode); + +REPLICATE_FIELD(string, cvar_cl_weaponpriority); +REPLICATE_FIELD(string, cvar_cl_weaponpriorities[10]); + #ifdef CSQC 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"); -REPLICATE(cvar_cl_accuracy_data_receive, bool, "cl_accuracy_data_receive"); #endif #ifdef SVQC @@ -410,27 +416,4 @@ string W_FixWeaponOrder_ForceComplete_AndBuildImpulseList(entity this, string wo string W_FixWeaponOrder_AllowIncomplete(entity this, string order); #endif -REPLICATE_FIELD(int, cvar_cl_gunalign); -REPLICATE_FIELD(bool, cvar_cl_weapon_switch_reload); -REPLICATE_FIELD(bool, cvar_cl_weapon_switch_fallback_to_impulse); -REPLICATE_FIELD(int, cvar_cl_weaponimpulsemode); -REPLICATE(cvar_cl_gunalign, int, "cl_gunalign"); -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"); -REPLICATE(cvar_cl_weaponimpulsemode, int, "cl_weaponimpulsemode"); - -REPLICATE_FIELD(string, cvar_cl_weaponpriority); -REPLICATE_FIELD(string, cvar_cl_weaponpriorities[10]); -REPLICATE(cvar_cl_weaponpriority, string, "cl_weaponpriority", W_FixWeaponOrder_ForceComplete_AndBuildImpulseList); -REPLICATE(cvar_cl_weaponpriorities[0], string, "cl_weaponpriority0", W_FixWeaponOrder_AllowIncomplete); -REPLICATE(cvar_cl_weaponpriorities[1], string, "cl_weaponpriority1", W_FixWeaponOrder_AllowIncomplete); -REPLICATE(cvar_cl_weaponpriorities[2], string, "cl_weaponpriority2", W_FixWeaponOrder_AllowIncomplete); -REPLICATE(cvar_cl_weaponpriorities[3], string, "cl_weaponpriority3", W_FixWeaponOrder_AllowIncomplete); -REPLICATE(cvar_cl_weaponpriorities[4], string, "cl_weaponpriority4", W_FixWeaponOrder_AllowIncomplete); -REPLICATE(cvar_cl_weaponpriorities[5], string, "cl_weaponpriority5", W_FixWeaponOrder_AllowIncomplete); -REPLICATE(cvar_cl_weaponpriorities[6], string, "cl_weaponpriority6", W_FixWeaponOrder_AllowIncomplete); -REPLICATE(cvar_cl_weaponpriorities[7], string, "cl_weaponpriority7", W_FixWeaponOrder_AllowIncomplete); -REPLICATE(cvar_cl_weaponpriorities[8], string, "cl_weaponpriority8", W_FixWeaponOrder_AllowIncomplete); -REPLICATE(cvar_cl_weaponpriorities[9], string, "cl_weaponpriority9", W_FixWeaponOrder_AllowIncomplete); - #endif diff --git a/qcsrc/server/race.qc b/qcsrc/server/race.qc index 5ccb607e9..dda32ac2a 100644 --- a/qcsrc/server/race.qc +++ b/qcsrc/server/race.qc @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include diff --git a/qcsrc/server/weapons/accuracy.qc b/qcsrc/server/weapons/accuracy.qc index 337ae54a9..150d480ec 100644 --- a/qcsrc/server/weapons/accuracy.qc +++ b/qcsrc/server/weapons/accuracy.qc @@ -133,3 +133,6 @@ bool accuracy_canbegooddamage(entity attacker) { return !warmup_stage && IS_CLIENT(attacker); } + +REPLICATE(cvar_cl_accuracy_data_share, bool, "cl_accuracy_data_share"); +REPLICATE(cvar_cl_accuracy_data_receive, bool, "cl_accuracy_data_receive"); diff --git a/qcsrc/server/weapons/accuracy.qh b/qcsrc/server/weapons/accuracy.qh index b1375b5a0..a7fb3e11e 100644 --- a/qcsrc/server/weapons/accuracy.qh +++ b/qcsrc/server/weapons/accuracy.qh @@ -22,8 +22,6 @@ float autocvar_sv_accuracy_data_share = 1; 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"); -REPLICATE(cvar_cl_accuracy_data_receive, bool, "cl_accuracy_data_receive"); .entity accuracy; .float accuracy_frags[REGISTRY_MAX(Weapons)]; diff --git a/qcsrc/server/weapons/selection.qc b/qcsrc/server/weapons/selection.qc index ca331bb3c..0368f7f5f 100644 --- a/qcsrc/server/weapons/selection.qc +++ b/qcsrc/server/weapons/selection.qc @@ -346,3 +346,13 @@ void W_LastWeapon(entity this, .entity weaponentity) else W_SwitchToOtherWeapon(this, weaponentity); } + +// fix switchweapon (needed when spectating is disabled, as PutClientInServer comes too early) +REPLICATE_APPLYCHANGE("cl_weaponpriority", + for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot) + { + .entity weaponentity = weaponentities[slot]; + if (this.(weaponentity) && (this.(weaponentity).m_weapon != WEP_Null || slot == 0)) + this.(weaponentity).m_switchweapon = w_getbestweapon(this, weaponentity); + } +); diff --git a/qcsrc/server/weapons/selection.qh b/qcsrc/server/weapons/selection.qh index 3e28b4745..093d6612b 100644 --- a/qcsrc/server/weapons/selection.qh +++ b/qcsrc/server/weapons/selection.qh @@ -41,13 +41,3 @@ void W_PreviousWeapon(entity this, float list, .entity weaponentity); // previously used if exists and has ammo, (second) best otherwise void W_LastWeapon(entity this, .entity weaponentity); - -// fix switchweapon (needed when spectating is disabled, as PutClientInServer comes too early) -REPLICATE_APPLYCHANGE("cl_weaponpriority", - for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot) - { - .entity weaponentity = weaponentities[slot]; - if (this.(weaponentity) && (this.(weaponentity).m_weapon != WEP_Null || slot == 0)) - this.(weaponentity).m_switchweapon = w_getbestweapon(this, weaponentity); - } -);