]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Move more REPLICATE calls to \common and from qh files to qc files (it fixes compilat...
authorterencehill <piuntn@gmail.com>
Tue, 11 Jan 2022 00:05:31 +0000 (01:05 +0100)
committerterencehill <piuntn@gmail.com>
Tue, 11 Jan 2022 21:32:56 +0000 (22:32 +0100)
28 files changed:
qcsrc/common/effects/qc/casings.qc
qcsrc/common/effects/qc/casings.qh
qcsrc/common/effects/qc/globalsound.qc
qcsrc/common/effects/qc/globalsound.qh
qcsrc/common/mutators/mutator/buffs/buffs.qc
qcsrc/common/mutators/mutator/buffs/buffs.qh
qcsrc/common/mutators/mutator/dodging/cl_dodging.qc
qcsrc/common/mutators/mutator/dodging/cl_dodging.qh
qcsrc/common/mutators/mutator/dodging/sv_dodging.qc
qcsrc/common/mutators/mutator/dodging/sv_dodging.qh
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/spawn_near_teammate.qc
qcsrc/common/mutators/mutator/spawn_near_teammate/spawn_near_teammate.qh
qcsrc/common/physics/player.qc
qcsrc/common/physics/player.qh
qcsrc/common/playerstats.qc
qcsrc/common/playerstats.qh
qcsrc/common/replicate.qh
qcsrc/common/weapons/all.qc
qcsrc/common/weapons/all.qh
qcsrc/server/race.qc
qcsrc/server/weapons/accuracy.qc
qcsrc/server/weapons/accuracy.qh
qcsrc/server/weapons/selection.qc
qcsrc/server/weapons/selection.qh

index ba83821f7af297d81a80ef8b12742eaa9ae53a70..c0c7f5ac98d41bc95cb90948d4234f84c007f6dc 100644 (file)
@@ -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");
 
index 25f1087e4034c854f3cd655cf2f4215d7a0d66e6..f43e15a1cd6192790c2b7bf038473686f621e5b3 100644 (file)
@@ -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;
 
index 43a489105f67dccf94a2f9cb089800e9cfded321..f5eaf11cdb8c659efa2de3eb66d646d1aca98e47 100644 (file)
@@ -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
index 91eae388c49d3d1e0e577dbc900ebae9d22a210f..d9a7eac301c15db9afa102a13ee86027f4e602cb 100644 (file)
 .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) \
index 15cc199601b1999075e4812896733baa8a9bbee3..ce51e4fa4a368167eedae552d5d8a7d960ef67df 100644 (file)
@@ -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
index 44fe0f123dc0a86f8fae4902d85a83c43e0d70da..b5cd426bec7a2da58c0633513e363485473e8d04 100644 (file)
@@ -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
index a9d10efa706dbbdfb2e801c76e8e32b317b83b71..237ff0e9fabc12823248298723a65ed10d784edc 100644 (file)
@@ -1 +1,4 @@
 #include "cl_dodging.qh"
+
+REPLICATE(cvar_cl_dodging_timeout, float, "cl_dodging_timeout");
+REPLICATE(cvar_cl_dodging, bool, "cl_dodging");
index 696a2d9e5856c64c9c12329b66b4664fd607cbdc..d7c5a52627ea3ce3ddd705fedce25aa7eecd8b4f 100644 (file)
@@ -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);
index 956b544841d6b06d78c5e1f775173a7c5ce1ba68..8af5092226109f9664f78165d376355f5034934b 100644 (file)
@@ -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");
 
index 6f70f09beec2219624baeca92e2cd7deaa104fb4..e04c2ffbc21af18abff6edda5d32a15c13ded4d3 100644 (file)
@@ -1 +1,4 @@
 #pragma once
+
+REPLICATE_FIELD(bool, cvar_cl_dodging);
+REPLICATE_FIELD(float, cvar_cl_dodging_timeout);
index 5c7838b36b28ee2d34c996e90f2ba3fa4337113e..5f904ecf1acc99a510d338bcc91041301a32472a 100644 (file)
@@ -2,6 +2,8 @@
 
 #ifdef GAMEQC
 
+REPLICATE(cvar_cl_multijump, bool, "cl_multijump");
+
 #ifdef SVQC
        #include <server/antilag.qh>
 #endif
index 2d2dc015ab823f21f19a3d3d9d9206a2ab7f66e2..8073b558300bd24e5b52a899eb6f3ad248bf87d4 100644 (file)
@@ -2,5 +2,4 @@
 
 #ifdef GAMEQC
 REPLICATE_FIELD(int, cvar_cl_multijump);
-REPLICATE(cvar_cl_multijump, bool, "cl_multijump");
 #endif
index a8eb3b5f693db0bf71564950c574d0e0e3b5e917..2869d4f220def17140853c61e13c6a5b368513a3 100644 (file)
@@ -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)
index 791c18b4b15953bca9324a10aac12c04202d18ac..957824a774862b9e7b8b6e8c3dccef965bdd3574 100644 (file)
@@ -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
index 7453747703a8c02311822895d8e14b13f3bf01d0..218e00ef247b7f35b09269a6d6e2414844fdc44e 100644 (file)
@@ -1 +1,5 @@
 #include "spawn_near_teammate.qh"
+
+#ifdef GAMEQC
+REPLICATE(cvar_cl_spawn_near_teammate, bool, "cl_spawn_near_teammate");
+#endif
index 6b08873ba71ba559b820fbe75e7dc5038c5b5427..881df9ed2f9df6666116edcb1372b4ec97e16dcf 100644 (file)
@@ -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
index 2b3c51374dfad689a9da0e46c520bb5abe37db34..75ebfd2ce630f533492ed31bc770b236a9739d74 100644 (file)
@@ -3,6 +3,12 @@
 #include <common/mapobjects/_mod.qh>
 #include <common/viewloc.qh>
 
+#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 <common/mapobjects/defs.qh>
 #include <common/mapobjects/trigger/viewloc.qh>
index 4e2b656d812a484f83e9dac82591064b833c690c..034393f29cb717204dd455b6d48f750339911785 100644 (file)
@@ -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)
index 3d0ca1ee6d6154f731f4eff2884522d7b5091552..ac3c46822ef472574a08809e41f90ca6058c3640 100644 (file)
        #include <server/world.qh>
 #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()
 {
index 39ffab623ef94d5f3790d2e7e9693efa75528ecc..4383ee3eb4a8253a8e05401bc13edda590b8f091 100644 (file)
@@ -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
index cd10e5a31865b9fd608a3eff91569ceebebd44aa..65ceecf1f4d59428ad8438bfe9eba3fb95a8076c 100644 (file)
@@ -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
index f44668061f16083c7ee0e57ebea5674a95e7f75d..00e71e0debe942fe1a0ef0c9bd8933ca4a634da7 100644 (file)
@@ -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
index d2c8c09e84518097100441e96207275530d74d9a..08d185e31da59468b3566fbcb08447c78f6688bd 100644 (file)
@@ -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
index 5ccb607e926ce13362fc2d11e4c1e444b7bdeb01..dda32ac2a419c92135177b28820a8a14ae47ed58 100644 (file)
@@ -8,6 +8,7 @@
 #include <common/mutators/mutator/waypoints/waypointsprites.qh>
 #include <common/net_linked.qh>
 #include <common/notifications/all.qh>
+#include <common/playerstats.qh>
 #include <common/state.qh>
 #include <common/stats.qh>
 #include <common/vehicles/sv_vehicles.qh>
index 337ae54a98c86d4b889bb03da4b1cac0439116ee..150d480ec1e79c2e6496b684d2ca4e7926a4769a 100644 (file)
@@ -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");
index b1375b5a0a547ed461c41be8f8399fff156d524c..a7fb3e11ee3c8d12c39fc19ea835bfb6323dc4b3 100644 (file)
@@ -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)];
index ca331bb3c49af73091d4b0020f535d95e2bdc68b..0368f7f5f9cb9a51c2157793c8724e98713e510e 100644 (file)
@@ -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);
+       }
+);
index 3e28b47455cd0413d1529ab0f779df2f7cfb7f91..093d6612b348052416bbf609e26217583914b398 100644 (file)
@@ -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);
-       }
-);