From c54f00d44afe3b7d3a95d03d8d0a13525d638c9f Mon Sep 17 00:00:00 2001 From: TimePath Date: Fri, 14 Aug 2015 16:18:05 +1000 Subject: [PATCH] Use explicit IMPLEMENTATION guard --- qcsrc/common/weapons/all.qc | 2 ++ qcsrc/common/weapons/w_arc.qc | 5 +++-- qcsrc/common/weapons/w_blaster.qc | 5 +++-- qcsrc/common/weapons/w_crylink.qc | 5 +++-- qcsrc/common/weapons/w_devastator.qc | 5 +++-- qcsrc/common/weapons/w_electro.qc | 5 +++-- qcsrc/common/weapons/w_fireball.qc | 5 +++-- qcsrc/common/weapons/w_hagar.qc | 5 +++-- qcsrc/common/weapons/w_hlac.qc | 5 +++-- qcsrc/common/weapons/w_hmg.qc | 5 +++-- qcsrc/common/weapons/w_hook.qc | 5 +++-- qcsrc/common/weapons/w_machinegun.qc | 5 +++-- qcsrc/common/weapons/w_minelayer.qc | 5 +++-- qcsrc/common/weapons/w_mortar.qc | 5 +++-- qcsrc/common/weapons/w_porto.qc | 5 +++-- qcsrc/common/weapons/w_rifle.qc | 5 +++-- qcsrc/common/weapons/w_rpc.qc | 5 +++-- qcsrc/common/weapons/w_seeker.qc | 5 +++-- qcsrc/common/weapons/w_shockwave.qc | 5 +++-- qcsrc/common/weapons/w_shotgun.qc | 5 +++-- qcsrc/common/weapons/w_tuba.qc | 5 +++-- qcsrc/common/weapons/w_vaporizer.qc | 5 +++-- qcsrc/common/weapons/w_vortex.qc | 5 +++-- qcsrc/menu/oo/classes.qc | 1 + 24 files changed, 69 insertions(+), 44 deletions(-) diff --git a/qcsrc/common/weapons/all.qc b/qcsrc/common/weapons/all.qc index 72c92471a..00c801240 100644 --- a/qcsrc/common/weapons/all.qc +++ b/qcsrc/common/weapons/all.qc @@ -54,7 +54,9 @@ #ifndef MENUQC #include "calculations.qc" #endif +#define IMPLEMENTATION #include "all.inc" +#undef IMPLEMENTATION // WEAPON PLUGIN SYSTEM entity weapon_info[WEP_MAXCOUNT]; diff --git a/qcsrc/common/weapons/w_arc.qc b/qcsrc/common/weapons/w_arc.qc index 79d4dc7c7..d661f4eba 100644 --- a/qcsrc/common/weapons/w_arc.qc +++ b/qcsrc/common/weapons/w_arc.qc @@ -1,4 +1,4 @@ -#ifdef REGISTER_WEAPON +#ifndef IMPLEMENTATION REGISTER_WEAPON( /* WEP_##id */ ARC, /* function */ W_Arc, @@ -123,7 +123,8 @@ float Draw_ArcBeam_callback_last_thickness; vector Draw_ArcBeam_callback_last_top; // NOTE: in same coordinate system as player. vector Draw_ArcBeam_callback_last_bottom; // NOTE: in same coordinate system as player. #endif -#else +#endif +#ifdef IMPLEMENTATION #ifdef SVQC void spawnfunc_weapon_arc(void) { weapon_defaultspawnfunc(WEP_ARC); } diff --git a/qcsrc/common/weapons/w_blaster.qc b/qcsrc/common/weapons/w_blaster.qc index a776edbf4..2d582c6c0 100644 --- a/qcsrc/common/weapons/w_blaster.qc +++ b/qcsrc/common/weapons/w_blaster.qc @@ -1,4 +1,4 @@ -#ifdef REGISTER_WEAPON +#ifndef IMPLEMENTATION REGISTER_WEAPON( /* WEP_##id */ BLASTER, /* function */ W_Blaster, @@ -45,7 +45,8 @@ BLASTER_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP) .float blaster_force; .float blaster_lifetime; #endif -#else +#endif +#ifdef IMPLEMENTATION #ifdef SVQC void spawnfunc_weapon_blaster(void) { weapon_defaultspawnfunc(WEP_BLASTER); } void spawnfunc_weapon_laser(void) { spawnfunc_weapon_blaster(); } diff --git a/qcsrc/common/weapons/w_crylink.qc b/qcsrc/common/weapons/w_crylink.qc index 4d4430206..718dbed31 100644 --- a/qcsrc/common/weapons/w_crylink.qc +++ b/qcsrc/common/weapons/w_crylink.qc @@ -1,4 +1,4 @@ -#ifdef REGISTER_WEAPON +#ifndef IMPLEMENTATION REGISTER_WEAPON( /* WEP_##id */ CRYLINK, /* function */ W_Crylink, @@ -61,7 +61,8 @@ CRYLINK_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP) .entity queuenext; .entity queueprev; #endif -#else +#endif +#ifdef IMPLEMENTATION #ifdef SVQC void spawnfunc_weapon_crylink(void) { weapon_defaultspawnfunc(WEP_CRYLINK); } diff --git a/qcsrc/common/weapons/w_devastator.qc b/qcsrc/common/weapons/w_devastator.qc index e9e0467e2..f6dcba033 100644 --- a/qcsrc/common/weapons/w_devastator.qc +++ b/qcsrc/common/weapons/w_devastator.qc @@ -1,4 +1,4 @@ -#ifdef REGISTER_WEAPON +#ifndef IMPLEMENTATION REGISTER_WEAPON( /* WEP_##id */ DEVASTATOR, /* function */ W_Devastator, @@ -59,7 +59,8 @@ DEVASTATOR_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP) .float rl_release; .float rl_detonate_later; #endif -#else +#endif +#ifdef IMPLEMENTATION #ifdef SVQC void spawnfunc_weapon_devastator(void) { weapon_defaultspawnfunc(WEP_DEVASTATOR); } void spawnfunc_weapon_rocketlauncher(void) { spawnfunc_weapon_devastator(); } diff --git a/qcsrc/common/weapons/w_electro.qc b/qcsrc/common/weapons/w_electro.qc index e3b809296..05e696987 100644 --- a/qcsrc/common/weapons/w_electro.qc +++ b/qcsrc/common/weapons/w_electro.qc @@ -1,4 +1,4 @@ -#ifdef REGISTER_WEAPON +#ifndef IMPLEMENTATION REGISTER_WEAPON( /* WEP_##id */ ELECTRO, /* function */ W_Electro, @@ -64,7 +64,8 @@ ELECTRO_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP) .float electro_secondarytime; void W_Electro_ExplodeCombo(void); #endif -#else +#endif +#ifdef IMPLEMENTATION #ifdef SVQC void spawnfunc_weapon_electro(void) { weapon_defaultspawnfunc(WEP_ELECTRO); } diff --git a/qcsrc/common/weapons/w_fireball.qc b/qcsrc/common/weapons/w_fireball.qc index 7bb5ccb66..3129a0da5 100644 --- a/qcsrc/common/weapons/w_fireball.qc +++ b/qcsrc/common/weapons/w_fireball.qc @@ -1,4 +1,4 @@ -#ifdef REGISTER_WEAPON +#ifndef IMPLEMENTATION REGISTER_WEAPON( /* WEP_##id */ FIREBALL, /* function */ W_Fireball, @@ -52,7 +52,8 @@ FIREBALL_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP) .vector fireball_impactvec; .float fireball_primarytime; #endif -#else +#endif +#ifdef IMPLEMENTATION #ifdef SVQC void spawnfunc_weapon_fireball(void) { weapon_defaultspawnfunc(WEP_FIREBALL); } diff --git a/qcsrc/common/weapons/w_hagar.qc b/qcsrc/common/weapons/w_hagar.qc index 4c9f66498..44fab91e0 100644 --- a/qcsrc/common/weapons/w_hagar.qc +++ b/qcsrc/common/weapons/w_hagar.qc @@ -1,4 +1,4 @@ -#ifdef REGISTER_WEAPON +#ifndef IMPLEMENTATION REGISTER_WEAPON( /* WEP_##id */ HAGAR, /* function */ W_Hagar, @@ -53,7 +53,8 @@ REGISTER_WEAPON( #ifdef SVQC HAGAR_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP) #endif -#else +#endif +#ifdef IMPLEMENTATION #ifdef SVQC void spawnfunc_weapon_hagar(void) { weapon_defaultspawnfunc(WEP_HAGAR); } diff --git a/qcsrc/common/weapons/w_hlac.qc b/qcsrc/common/weapons/w_hlac.qc index 7f7d7a27b..8c5a03526 100644 --- a/qcsrc/common/weapons/w_hlac.qc +++ b/qcsrc/common/weapons/w_hlac.qc @@ -1,4 +1,4 @@ -#ifdef REGISTER_WEAPON +#ifndef IMPLEMENTATION REGISTER_WEAPON( /* WEP_##id */ HLAC, /* function */ W_HLAC, @@ -45,7 +45,8 @@ REGISTER_WEAPON( #ifdef SVQC HLAC_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP) #endif -#else +#endif +#ifdef IMPLEMENTATION #ifdef SVQC void spawnfunc_weapon_hlac(void) { weapon_defaultspawnfunc(WEP_HLAC); } diff --git a/qcsrc/common/weapons/w_hmg.qc b/qcsrc/common/weapons/w_hmg.qc index de9c983b2..e01034442 100644 --- a/qcsrc/common/weapons/w_hmg.qc +++ b/qcsrc/common/weapons/w_hmg.qc @@ -1,4 +1,4 @@ -#ifdef REGISTER_WEAPON +#ifndef IMPLEMENTATION REGISTER_WEAPON( /* WEP_##id */ HMG, /* function */ W_HeavyMachineGun, @@ -37,7 +37,8 @@ REGISTER_WEAPON( #ifdef SVQC HMG_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP) #endif -#else +#endif +#ifdef IMPLEMENTATION #ifdef SVQC void spawnfunc_weapon_hmg() { weapon_defaultspawnfunc(WEP_HMG); } diff --git a/qcsrc/common/weapons/w_hook.qc b/qcsrc/common/weapons/w_hook.qc index 1c05c23d6..d833f8d17 100644 --- a/qcsrc/common/weapons/w_hook.qc +++ b/qcsrc/common/weapons/w_hook.qc @@ -1,4 +1,4 @@ -#ifdef REGISTER_WEAPON +#ifndef IMPLEMENTATION REGISTER_WEAPON( /* WEP_##id */ HOOK, /* function */ W_Hook, @@ -55,7 +55,8 @@ HOOK_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP) .float hook_time_hooked; .float hook_time_fueldecrease; #endif -#else +#endif +#ifdef IMPLEMENTATION #ifdef SVQC void spawnfunc_weapon_hook(void) diff --git a/qcsrc/common/weapons/w_machinegun.qc b/qcsrc/common/weapons/w_machinegun.qc index 24a0db83f..7e2cc5278 100644 --- a/qcsrc/common/weapons/w_machinegun.qc +++ b/qcsrc/common/weapons/w_machinegun.qc @@ -1,4 +1,4 @@ -#ifdef REGISTER_WEAPON +#ifndef IMPLEMENTATION REGISTER_WEAPON( /* WEP_##id */ MACHINEGUN, /* function */ W_MachineGun, @@ -51,7 +51,8 @@ REGISTER_WEAPON( #ifdef SVQC MACHINEGUN_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP) #endif -#else +#endif +#ifdef IMPLEMENTATION #ifdef SVQC void spawnfunc_weapon_machinegun(void) diff --git a/qcsrc/common/weapons/w_minelayer.qc b/qcsrc/common/weapons/w_minelayer.qc index d4ef95547..dd449e839 100644 --- a/qcsrc/common/weapons/w_minelayer.qc +++ b/qcsrc/common/weapons/w_minelayer.qc @@ -1,4 +1,4 @@ -#ifdef REGISTER_WEAPON +#ifndef IMPLEMENTATION REGISTER_WEAPON( /* WEP_##id */ MINE_LAYER, /* function */ W_MineLayer, @@ -54,7 +54,8 @@ void W_MineLayer_Think(void); .float mine_time; .vector mine_orientation; #endif -#else +#endif +#ifdef IMPLEMENTATION #ifdef SVQC void spawnfunc_weapon_minelayer(void) { weapon_defaultspawnfunc(WEP_MINE_LAYER); } diff --git a/qcsrc/common/weapons/w_mortar.qc b/qcsrc/common/weapons/w_mortar.qc index c958372af..615c30c59 100644 --- a/qcsrc/common/weapons/w_mortar.qc +++ b/qcsrc/common/weapons/w_mortar.qc @@ -1,4 +1,4 @@ -#ifdef REGISTER_WEAPON +#ifndef IMPLEMENTATION REGISTER_WEAPON( /* WEP_##id */ MORTAR, /* function */ W_Mortar, @@ -52,7 +52,8 @@ MORTAR_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP) .float gl_detonate_later; .float gl_bouncecnt; #endif -#else +#endif +#ifdef IMPLEMENTATION #ifdef SVQC void spawnfunc_weapon_mortar(void) { weapon_defaultspawnfunc(WEP_MORTAR); } diff --git a/qcsrc/common/weapons/w_porto.qc b/qcsrc/common/weapons/w_porto.qc index 82baf07bd..f3976fc6a 100644 --- a/qcsrc/common/weapons/w_porto.qc +++ b/qcsrc/common/weapons/w_porto.qc @@ -1,4 +1,4 @@ -#ifdef REGISTER_WEAPON +#ifndef IMPLEMENTATION REGISTER_WEAPON( /* WEP_##id */ PORTO, /* function */ W_Porto, @@ -36,7 +36,8 @@ PORTO_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP) .float porto_v_angle_held; .vector right_vector; #endif -#else +#endif +#ifdef IMPLEMENTATION #ifdef SVQC #include "../triggers/trigger/jumppads.qh" diff --git a/qcsrc/common/weapons/w_rifle.qc b/qcsrc/common/weapons/w_rifle.qc index 16d6ad6f8..eb80215bc 100644 --- a/qcsrc/common/weapons/w_rifle.qc +++ b/qcsrc/common/weapons/w_rifle.qc @@ -1,4 +1,4 @@ -#ifdef REGISTER_WEAPON +#ifndef IMPLEMENTATION REGISTER_WEAPON( /* WEP_##id */ RIFLE, /* function */ W_Rifle, @@ -44,7 +44,8 @@ REGISTER_WEAPON( RIFLE_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP) .float rifle_accumulator; #endif -#else +#endif +#ifdef IMPLEMENTATION #ifdef SVQC void spawnfunc_weapon_rifle(void) { weapon_defaultspawnfunc(WEP_RIFLE); } void spawnfunc_weapon_campingrifle(void) { spawnfunc_weapon_rifle(); } diff --git a/qcsrc/common/weapons/w_rpc.qc b/qcsrc/common/weapons/w_rpc.qc index d641572c3..f26649b8b 100644 --- a/qcsrc/common/weapons/w_rpc.qc +++ b/qcsrc/common/weapons/w_rpc.qc @@ -1,4 +1,4 @@ -#ifdef REGISTER_WEAPON +#ifndef IMPLEMENTATION REGISTER_WEAPON( /* WEP_##id */ RPC, /* function */ W_RocketPropelledChainsaw, @@ -42,7 +42,8 @@ REGISTER_WEAPON( #ifdef SVQC RPC_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP) #endif -#else +#endif +#ifdef IMPLEMENTATION #ifdef SVQC void spawnfunc_weapon_rpc() { weapon_defaultspawnfunc(WEP_RPC); } diff --git a/qcsrc/common/weapons/w_seeker.qc b/qcsrc/common/weapons/w_seeker.qc index f338ed7ea..f3d1ea836 100644 --- a/qcsrc/common/weapons/w_seeker.qc +++ b/qcsrc/common/weapons/w_seeker.qc @@ -1,4 +1,4 @@ -#ifdef REGISTER_WEAPON +#ifndef IMPLEMENTATION REGISTER_WEAPON( /* WEP_##id */ SEEKER, /* function */ W_Seeker, @@ -81,7 +81,8 @@ SEEKER_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP) .entity tag_target, wps_tag_tracker; .float tag_time; #endif -#else +#endif +#ifdef IMPLEMENTATION #ifdef SVQC void spawnfunc_weapon_seeker(void) { weapon_defaultspawnfunc(WEP_SEEKER); } diff --git a/qcsrc/common/weapons/w_shockwave.qc b/qcsrc/common/weapons/w_shockwave.qc index d23ce753a..1c0be5503 100644 --- a/qcsrc/common/weapons/w_shockwave.qc +++ b/qcsrc/common/weapons/w_shockwave.qc @@ -1,4 +1,4 @@ -#ifdef REGISTER_WEAPON +#ifndef IMPLEMENTATION REGISTER_WEAPON( /* WEP_##id */ SHOCKWAVE, /* function */ W_Shockwave, @@ -79,7 +79,8 @@ void Net_ReadShockwaveParticle(void); .float sw_spread_min; .float sw_time; #endif -#else +#endif +#ifdef IMPLEMENTATION #ifdef SVQC void spawnfunc_weapon_shockwave(void) { diff --git a/qcsrc/common/weapons/w_shotgun.qc b/qcsrc/common/weapons/w_shotgun.qc index 5415b4a6f..fb03b986f 100644 --- a/qcsrc/common/weapons/w_shotgun.qc +++ b/qcsrc/common/weapons/w_shotgun.qc @@ -1,4 +1,4 @@ -#ifdef REGISTER_WEAPON +#ifndef IMPLEMENTATION REGISTER_WEAPON( /* WEP_##id */ SHOTGUN, /* function */ W_Shotgun, @@ -49,7 +49,8 @@ REGISTER_WEAPON( #ifdef SVQC SHOTGUN_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP) #endif -#else +#endif +#ifdef IMPLEMENTATION #ifdef SVQC void spawnfunc_weapon_shotgun(void) { weapon_defaultspawnfunc(WEP_SHOTGUN); } diff --git a/qcsrc/common/weapons/w_tuba.qc b/qcsrc/common/weapons/w_tuba.qc index 3c40519d6..d8d3cf0e0 100644 --- a/qcsrc/common/weapons/w_tuba.qc +++ b/qcsrc/common/weapons/w_tuba.qc @@ -1,4 +1,4 @@ -#ifdef REGISTER_WEAPON +#ifndef IMPLEMENTATION REGISTER_WEAPON( /* WEP_##id */ TUBA, /* function */ W_Tuba, @@ -51,7 +51,8 @@ float W_Tuba_MarkClientOnlyFieldsAsUsed() { .float tuba_lastnotes_cnt; // over .vector tuba_lastnotes[MAX_TUBANOTES]; #endif -#else +#endif +#ifdef IMPLEMENTATION #ifdef SVQC void spawnfunc_weapon_tuba(void) { weapon_defaultspawnfunc(WEP_TUBA); } diff --git a/qcsrc/common/weapons/w_vaporizer.qc b/qcsrc/common/weapons/w_vaporizer.qc index b67056f7e..83ebcf0ec 100644 --- a/qcsrc/common/weapons/w_vaporizer.qc +++ b/qcsrc/common/weapons/w_vaporizer.qc @@ -1,4 +1,4 @@ -#ifdef REGISTER_WEAPON +#ifndef IMPLEMENTATION REGISTER_WEAPON( /* WEP_##id */ VAPORIZER, /* function */ W_Vaporizer, @@ -46,7 +46,8 @@ VAPORIZER_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP) .float vaporizer_lasthit; .float jump_interval; #endif -#else +#endif +#ifdef IMPLEMENTATION #ifdef SVQC void spawnfunc_weapon_vaporizer(void) { weapon_defaultspawnfunc(WEP_VAPORIZER); } void spawnfunc_weapon_minstanex(void) { spawnfunc_weapon_vaporizer(); } diff --git a/qcsrc/common/weapons/w_vortex.qc b/qcsrc/common/weapons/w_vortex.qc index 3c0d21354..d29264a19 100644 --- a/qcsrc/common/weapons/w_vortex.qc +++ b/qcsrc/common/weapons/w_vortex.qc @@ -1,4 +1,4 @@ -#ifdef REGISTER_WEAPON +#ifndef IMPLEMENTATION REGISTER_WEAPON( /* WEP_##id */ VORTEX, /* function */ W_Vortex, @@ -56,7 +56,8 @@ VORTEX_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP) .float vortex_lasthit; #endif -#else +#endif +#ifdef IMPLEMENTATION #ifdef SVQC void spawnfunc_weapon_vortex(void) { weapon_defaultspawnfunc(WEP_VORTEX); } void spawnfunc_weapon_nex(void) { spawnfunc_weapon_vortex(); } diff --git a/qcsrc/menu/oo/classes.qc b/qcsrc/menu/oo/classes.qc index 2170a83fc..4a14eea7b 100644 --- a/qcsrc/menu/oo/classes.qc +++ b/qcsrc/menu/oo/classes.qc @@ -5,5 +5,6 @@ #include "../classes.inc" #define IMPLEMENTATION #include "../classes.inc" +#undef IMPLEMENTATION #endif -- 2.39.2