From 5eb0a74157282c0858f02200fa81fdeba42d0c16 Mon Sep 17 00:00:00 2001 From: TimePath Date: Thu, 5 Nov 2015 14:54:17 +1100 Subject: [PATCH] Onslaught: move controlpoint + generator to mutator module --- qcsrc/client/main.qc | 12 ---------- qcsrc/client/progs.inc | 2 -- qcsrc/common/constants.qh | 2 -- qcsrc/common/gamemodes/all.inc | 3 ++- .../gamemodes/gamemode/nexball/module.inc | 2 ++ .../gamemodes/gamemode/nexball/nexball.qh | 2 -- .../gamemode/onslaught/cl_controlpoint.qc} | 8 +++---- .../gamemode/onslaught/cl_controlpoint.qh} | 2 -- .../gamemode/onslaught/cl_generator.qc} | 10 ++++---- .../gamemode/onslaught/cl_generator.qh} | 1 - .../gamemodes/gamemode/onslaught/module.inc | 24 +++++++++++++++++++ .../gamemode/onslaught/onslaught.qc} | 6 +++-- .../gamemode/onslaught/sv_controlpoint.qc} | 4 +--- .../gamemode/onslaught/sv_controlpoint.qh} | 0 .../gamemode/onslaught/sv_generator.qc} | 2 +- .../gamemode/onslaught/sv_generator.qh} | 0 qcsrc/server/mutators/all.inc | 1 - qcsrc/server/progs.inc | 2 -- 18 files changed, 41 insertions(+), 42 deletions(-) create mode 100644 qcsrc/common/gamemodes/gamemode/nexball/module.inc rename qcsrc/{client/controlpoint.qc => common/gamemodes/gamemode/onslaught/cl_controlpoint.qc} (97%) rename qcsrc/{client/controlpoint.qh => common/gamemodes/gamemode/onslaught/cl_controlpoint.qh} (86%) rename qcsrc/{client/generator.qc => common/gamemodes/gamemode/onslaught/cl_generator.qc} (97%) rename qcsrc/{client/generator.qh => common/gamemodes/gamemode/onslaught/cl_generator.qh} (90%) create mode 100644 qcsrc/common/gamemodes/gamemode/onslaught/module.inc rename qcsrc/{server/mutators/mutator/gamemode_onslaught.qc => common/gamemodes/gamemode/onslaught/onslaught.qc} (99%) rename qcsrc/{server/controlpoint.qc => common/gamemodes/gamemode/onslaught/sv_controlpoint.qc} (94%) rename qcsrc/{server/controlpoint.qh => common/gamemodes/gamemode/onslaught/sv_controlpoint.qh} (100%) rename qcsrc/{server/generator.qc => common/gamemodes/gamemode/onslaught/sv_generator.qc} (96%) rename qcsrc/{server/generator.qh => common/gamemodes/gamemode/onslaught/sv_generator.qh} (100%) diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index 7ffc89298..7980d518d 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -1,9 +1,7 @@ #include "main.qh" -#include "controlpoint.qh" #include "damage.qh" #include "effects.qh" -#include "generator.qh" #include "gibs.qh" #include "hook.qh" #include "hud/all.qh" @@ -980,16 +978,6 @@ NET_HANDLE(ENT_CLIENT_TURRET, bool isnew) ent_turret(); return true; } -NET_HANDLE(ENT_CLIENT_GENERATOR, bool isnew) -{ - ent_generator(); - return true; -} -NET_HANDLE(ENT_CLIENT_CONTROLPOINT_ICON, bool isnew) -{ - ent_cpicon(this); - return true; -} NET_HANDLE(ENT_CLIENT_MODEL, bool isnew) { CSQCModel_Read(isnew); diff --git a/qcsrc/client/progs.inc b/qcsrc/client/progs.inc index a6678f344..e72a12794 100644 --- a/qcsrc/client/progs.inc +++ b/qcsrc/client/progs.inc @@ -3,11 +3,9 @@ #include "announcer.qc" #include "bgmscript.qc" -#include "controlpoint.qc" #include "csqcmodel_hooks.qc" #include "damage.qc" #include "effects.qc" -#include "generator.qc" #include "gibs.qc" #include "hook.qc" #include "hud/all.qc" diff --git a/qcsrc/common/constants.qh b/qcsrc/common/constants.qh index 8450fe964..21f095d97 100644 --- a/qcsrc/common/constants.qh +++ b/qcsrc/common/constants.qh @@ -104,8 +104,6 @@ REGISTER_NET_LINKED(ENT_CLIENT_TRIGGER_IMPULSE) REGISTER_NET_LINKED(ENT_CLIENT_SWAMP) REGISTER_NET_LINKED(ENT_CLIENT_CORNER) REGISTER_NET_LINKED(ENT_CLIENT_KEYLOCK) -REGISTER_NET_LINKED(ENT_CLIENT_GENERATOR) -REGISTER_NET_LINKED(ENT_CLIENT_CONTROLPOINT_ICON) REGISTER_NET_LINKED(ENT_CLIENT_MINIGAME) REGISTER_NET_LINKED(ENT_CLIENT_VIEWLOC) REGISTER_NET_LINKED(ENT_CLIENT_VIEWLOC_TRIGGER) diff --git a/qcsrc/common/gamemodes/all.inc b/qcsrc/common/gamemodes/all.inc index 4c24bebf5..bcdcd7c4c 100644 --- a/qcsrc/common/gamemodes/all.inc +++ b/qcsrc/common/gamemodes/all.inc @@ -1 +1,2 @@ -#include "gamemode/nexball/nexball.qc" +#include "gamemode/nexball/module.inc" +#include "gamemode/onslaught/module.inc" diff --git a/qcsrc/common/gamemodes/gamemode/nexball/module.inc b/qcsrc/common/gamemodes/gamemode/nexball/module.inc new file mode 100644 index 000000000..0d809629d --- /dev/null +++ b/qcsrc/common/gamemodes/gamemode/nexball/module.inc @@ -0,0 +1,2 @@ +#include "nexball.qc" +#include "weapon.qc" diff --git a/qcsrc/common/gamemodes/gamemode/nexball/nexball.qh b/qcsrc/common/gamemodes/gamemode/nexball/nexball.qh index 58bf6ec4d..9dd8042be 100644 --- a/qcsrc/common/gamemodes/gamemode/nexball/nexball.qh +++ b/qcsrc/common/gamemodes/gamemode/nexball/nexball.qh @@ -1,8 +1,6 @@ #ifndef GAMEMODE_NEXBALL_H #define GAMEMODE_NEXBALL_H -#include "weapon.qc" - #ifdef SVQC //EF_BRIGHTFIELD|EF_BRIGHTLIGHT|EF_DIMLIGHT|EF_BLUE|EF_RED|EF_FLAME const float BALL_EFFECTMASK = 1229; diff --git a/qcsrc/client/controlpoint.qc b/qcsrc/common/gamemodes/gamemode/onslaught/cl_controlpoint.qc similarity index 97% rename from qcsrc/client/controlpoint.qc rename to qcsrc/common/gamemodes/gamemode/onslaught/cl_controlpoint.qc index 575bce513..28ac85d79 100644 --- a/qcsrc/client/controlpoint.qc +++ b/qcsrc/common/gamemodes/gamemode/onslaught/cl_controlpoint.qc @@ -1,7 +1,4 @@ -#include "controlpoint.qh" - -#include "teamradar.qh" -#include "../common/movetypes/movetypes.qh" +#include "cl_controlpoint.qh" .vector colormod; .float alpha; @@ -157,8 +154,9 @@ void cpicon_changeteam(entity this) } } -void ent_cpicon(entity this) +NET_HANDLE(ENT_CLIENT_CONTROLPOINT_ICON, bool isnew) { + return = true; int sf = ReadByte(); if(sf & CPSF_SETUP) diff --git a/qcsrc/client/controlpoint.qh b/qcsrc/common/gamemodes/gamemode/onslaught/cl_controlpoint.qh similarity index 86% rename from qcsrc/client/controlpoint.qh rename to qcsrc/common/gamemodes/gamemode/onslaught/cl_controlpoint.qh index 5f2e89b4d..15586ea5d 100644 --- a/qcsrc/client/controlpoint.qh +++ b/qcsrc/common/gamemodes/gamemode/onslaught/cl_controlpoint.qh @@ -7,6 +7,4 @@ const vector CPICON_MAX = '32 32 25'; const int CPSF_STATUS = 4; const int CPSF_SETUP = 8; -void ent_cpicon(entity this); - #endif diff --git a/qcsrc/client/generator.qc b/qcsrc/common/gamemodes/gamemode/onslaught/cl_generator.qc similarity index 97% rename from qcsrc/client/generator.qc rename to qcsrc/common/gamemodes/gamemode/onslaught/cl_generator.qc index 281687963..f5b61117d 100644 --- a/qcsrc/client/generator.qc +++ b/qcsrc/common/gamemodes/gamemode/onslaught/cl_generator.qc @@ -1,7 +1,4 @@ -#include "generator.qh" - -#include "teamradar.qh" -#include "../common/movetypes/movetypes.qh" +#include "cl_generator.qh" .float alpha; .float scale; @@ -182,8 +179,9 @@ void generator_changeteam() } } -void ent_generator() -{SELFPARAM(); +NET_HANDLE(ENT_CLIENT_GENERATOR, bool isnew) +{ + return = true; int sf = ReadByte(); if(sf & GSF_SETUP) diff --git a/qcsrc/client/generator.qh b/qcsrc/common/gamemodes/gamemode/onslaught/cl_generator.qh similarity index 90% rename from qcsrc/client/generator.qh rename to qcsrc/common/gamemodes/gamemode/onslaught/cl_generator.qh index c60aff400..3c0cf2869 100644 --- a/qcsrc/client/generator.qh +++ b/qcsrc/common/gamemodes/gamemode/onslaught/cl_generator.qh @@ -6,5 +6,4 @@ const vector GENERATOR_MAX = '52 52 75'; const int GSF_STATUS = 4; const int GSF_SETUP = 8; -void ent_generator(); #endif diff --git a/qcsrc/common/gamemodes/gamemode/onslaught/module.inc b/qcsrc/common/gamemodes/gamemode/onslaught/module.inc new file mode 100644 index 000000000..fee33b14e --- /dev/null +++ b/qcsrc/common/gamemodes/gamemode/onslaught/module.inc @@ -0,0 +1,24 @@ +#ifndef ONS_CONSTANTS + #define ONS_CONSTANTS + REGISTER_NET_LINKED(ENT_CLIENT_GENERATOR) + REGISTER_NET_LINKED(ENT_CLIENT_CONTROLPOINT_ICON) +#endif + +#if defined(SVQC) + #include "onslaught.qc" + #ifndef IMPLEMENTATION + #include "sv_controlpoint.qh" + #include "sv_generator.qh" + #else + #include "sv_controlpoint.qc" + #include "sv_generator.qc" + #endif +#elif defined(CSQC) + #ifndef IMPLEMENTATION + #include "cl_controlpoint.qh" + #include "cl_generator.qh" + #else + #include "cl_controlpoint.qc" + #include "cl_generator.qc" + #endif +#endif diff --git a/qcsrc/server/mutators/mutator/gamemode_onslaught.qc b/qcsrc/common/gamemodes/gamemode/onslaught/onslaught.qc similarity index 99% rename from qcsrc/server/mutators/mutator/gamemode_onslaught.qc rename to qcsrc/common/gamemodes/gamemode/onslaught/onslaught.qc index 7540b3233..04b5a3f7b 100644 --- a/qcsrc/server/mutators/mutator/gamemode_onslaught.qc +++ b/qcsrc/common/gamemodes/gamemode/onslaught/onslaught.qc @@ -128,8 +128,8 @@ const int SP_ONS_TAKES = 6; #ifdef IMPLEMENTATION -#include "../../controlpoint.qh" -#include "../../generator.qh" +#include "sv_controlpoint.qh" +#include "sv_generator.qh" bool g_onslaught; @@ -1218,6 +1218,8 @@ int Onslaught_GetWinnerTeam() return -1; // no generators left? } +void nades_Clear(entity e); + #define ONS_OWNED_GENERATORS() ((redowned > 0) + (blueowned > 0) + (yellowowned > 0) + (pinkowned > 0)) #define ONS_OWNED_GENERATORS_OK() (ONS_OWNED_GENERATORS() > 1) bool Onslaught_CheckWinner() diff --git a/qcsrc/server/controlpoint.qc b/qcsrc/common/gamemodes/gamemode/onslaught/sv_controlpoint.qc similarity index 94% rename from qcsrc/server/controlpoint.qc rename to qcsrc/common/gamemodes/gamemode/onslaught/sv_controlpoint.qc index 74494b7ee..492428718 100644 --- a/qcsrc/server/controlpoint.qc +++ b/qcsrc/common/gamemodes/gamemode/onslaught/sv_controlpoint.qc @@ -1,6 +1,4 @@ -#include "controlpoint.qh" - -#include "command/common.qh" +#include "sv_controlpoint.qh" .bool iscaptured; diff --git a/qcsrc/server/controlpoint.qh b/qcsrc/common/gamemodes/gamemode/onslaught/sv_controlpoint.qh similarity index 100% rename from qcsrc/server/controlpoint.qh rename to qcsrc/common/gamemodes/gamemode/onslaught/sv_controlpoint.qh diff --git a/qcsrc/server/generator.qc b/qcsrc/common/gamemodes/gamemode/onslaught/sv_generator.qc similarity index 96% rename from qcsrc/server/generator.qc rename to qcsrc/common/gamemodes/gamemode/onslaught/sv_generator.qc index e6c746a75..cf8d234a3 100644 --- a/qcsrc/server/generator.qc +++ b/qcsrc/common/gamemodes/gamemode/onslaught/sv_generator.qc @@ -1,4 +1,4 @@ -#include "generator.qh" +#include "sv_generator.qh" bool generator_send(entity this, entity to, int sf) { diff --git a/qcsrc/server/generator.qh b/qcsrc/common/gamemodes/gamemode/onslaught/sv_generator.qh similarity index 100% rename from qcsrc/server/generator.qh rename to qcsrc/common/gamemodes/gamemode/onslaught/sv_generator.qh diff --git a/qcsrc/server/mutators/all.inc b/qcsrc/server/mutators/all.inc index b334137bd..1a80b4409 100644 --- a/qcsrc/server/mutators/all.inc +++ b/qcsrc/server/mutators/all.inc @@ -9,6 +9,5 @@ #include "mutator/gamemode_keepaway.qc" #include "mutator/gamemode_keyhunt.qc" #include "mutator/gamemode_lms.qc" -#include "mutator/gamemode_onslaught.qc" #include "mutator/gamemode_race.qc" #include "mutator/gamemode_tdm.qc" diff --git a/qcsrc/server/progs.inc b/qcsrc/server/progs.inc index a68f9dd71..2a1be6257 100644 --- a/qcsrc/server/progs.inc +++ b/qcsrc/server/progs.inc @@ -8,7 +8,6 @@ #include "cl_client.qc" #include "cl_impulse.qc" #include "cl_player.qc" -#include "controlpoint.qc" #include "csqceffects.qc" #include "ent_cs.qc" #include "g_damage.qc" @@ -18,7 +17,6 @@ #include "g_subs.qc" #include "g_violence.qc" #include "g_world.qc" -#include "generator.qc" #include "ipban.qc" #include "item_key.qc" #include "mapvoting.qc" -- 2.39.2