From a28262196252bb70222525b589104054806b2c0a Mon Sep 17 00:00:00 2001 From: TimePath Date: Sat, 20 Aug 2016 16:42:01 +1000 Subject: [PATCH] Cleanup server mutator #includes --- qcsrc/common/monsters/sv_monsters.qc | 2 +- qcsrc/common/notifications/all.qc | 2 +- qcsrc/common/t_items.qc | 2 +- qcsrc/common/weapons/all.qc | 2 +- qcsrc/menu/command/_all.inc | 2 + qcsrc/menu/command/_all.qh | 2 + qcsrc/menu/command/_mod.inc | 1 - qcsrc/menu/command/_mod.qh | 1 - qcsrc/menu/command/all.qc | 3 - qcsrc/server/bot/default/aim.qc | 2 +- qcsrc/server/bot/default/bot.qc | 2 +- qcsrc/server/bot/null/_mod.inc | 2 + qcsrc/server/bot/null/_mod.qh | 2 + qcsrc/server/cheats.qc | 2 +- qcsrc/server/command/cmd.qc | 2 +- qcsrc/server/command/sv_cmd.qc | 2 +- qcsrc/server/command/vote.qc | 2 +- qcsrc/server/g_damage.qc | 2 +- qcsrc/server/g_damage.qh | 2 +- qcsrc/server/g_world.qc | 2 +- qcsrc/server/miscfunctions.qc | 2 +- qcsrc/server/mutators/_all.inc | 2 + qcsrc/server/mutators/_all.qh | 2 + qcsrc/server/mutators/_mod.inc | 2 +- qcsrc/server/mutators/_mod.qh | 2 +- qcsrc/server/mutators/all.inc | 13 --- qcsrc/server/mutators/all.qc | 85 ------------------- qcsrc/server/mutators/all.qh | 6 -- qcsrc/server/mutators/gamemode.qh | 68 +++++++++++++++ qcsrc/server/mutators/loader.qc | 11 +++ .../all.qh => server/mutators/loader.qh} | 0 qcsrc/server/mutators/mutator/_all.inc | 2 + qcsrc/server/mutators/mutator/_all.qh | 3 +- qcsrc/server/portals.qc | 2 +- qcsrc/server/scores.qc | 2 +- qcsrc/server/spawnpoints.qc | 2 +- qcsrc/server/sv_main.qc | 2 +- qcsrc/server/teamplay.qc | 2 +- qcsrc/server/weapons/accuracy.qc | 2 +- qcsrc/server/weapons/spawning.qc | 2 +- qcsrc/server/weapons/throwing.qc | 2 +- qcsrc/server/weapons/weaponsystem.qc | 2 +- 42 files changed, 120 insertions(+), 135 deletions(-) delete mode 100644 qcsrc/menu/command/all.qc create mode 100644 qcsrc/server/bot/null/_mod.inc create mode 100644 qcsrc/server/bot/null/_mod.qh delete mode 100644 qcsrc/server/mutators/all.inc delete mode 100644 qcsrc/server/mutators/all.qc delete mode 100644 qcsrc/server/mutators/all.qh create mode 100644 qcsrc/server/mutators/loader.qc rename qcsrc/{menu/command/all.qh => server/mutators/loader.qh} (100%) diff --git a/qcsrc/common/monsters/sv_monsters.qc b/qcsrc/common/monsters/sv_monsters.qc index 21d5ad73f..beca5ebbd 100644 --- a/qcsrc/common/monsters/sv_monsters.qc +++ b/qcsrc/common/monsters/sv_monsters.qc @@ -12,7 +12,7 @@ #include #include #include "../deathtypes/all.qh" - #include + #include #include #include "../turrets/sv_turrets.qh" #include "../turrets/util.qh" diff --git a/qcsrc/common/notifications/all.qc b/qcsrc/common/notifications/all.qc index e4f082355..49d2c57b7 100644 --- a/qcsrc/common/notifications/all.qc +++ b/qcsrc/common/notifications/all.qc @@ -8,7 +8,7 @@ #include #include #include "all.qh" - #include + #include #endif // ================================================ diff --git a/qcsrc/common/t_items.qc b/qcsrc/common/t_items.qc index bc914d853..32e718ae2 100644 --- a/qcsrc/common/t_items.qc +++ b/qcsrc/common/t_items.qc @@ -6,7 +6,7 @@ #include "../server/bot/api.qh" - #include + #include #include "../server/weapons/common.qh" #include "../server/weapons/selection.qh" diff --git a/qcsrc/common/weapons/all.qc b/qcsrc/common/weapons/all.qc index d1bd2d7e6..81790e6c0 100644 --- a/qcsrc/common/weapons/all.qc +++ b/qcsrc/common/weapons/all.qc @@ -37,7 +37,7 @@ #include #include "../notifications/all.qh" #include "../deathtypes/all.qh" - #include + #include #include "../mapinfo.qh" #include #include diff --git a/qcsrc/menu/command/_all.inc b/qcsrc/menu/command/_all.inc index 8bc63f720..2e1b0ab9e 100644 --- a/qcsrc/menu/command/_all.inc +++ b/qcsrc/menu/command/_all.inc @@ -1,2 +1,4 @@ #include "_all.qh" #include "_mod.inc" + +#include diff --git a/qcsrc/menu/command/_all.qh b/qcsrc/menu/command/_all.qh index 947026dd5..9b89bcdc1 100644 --- a/qcsrc/menu/command/_all.qh +++ b/qcsrc/menu/command/_all.qh @@ -1,2 +1,4 @@ #pragma once #include "_mod.qh" + +#include diff --git a/qcsrc/menu/command/_mod.inc b/qcsrc/menu/command/_mod.inc index e721f357a..0bcef50de 100644 --- a/qcsrc/menu/command/_mod.inc +++ b/qcsrc/menu/command/_mod.inc @@ -1,3 +1,2 @@ // generated file; do not modify -#include #include diff --git a/qcsrc/menu/command/_mod.qh b/qcsrc/menu/command/_mod.qh index 5e6655730..91c0a8f35 100644 --- a/qcsrc/menu/command/_mod.qh +++ b/qcsrc/menu/command/_mod.qh @@ -1,3 +1,2 @@ // generated file; do not modify -#include #include diff --git a/qcsrc/menu/command/all.qc b/qcsrc/menu/command/all.qc deleted file mode 100644 index 63b9b78a8..000000000 --- a/qcsrc/menu/command/all.qc +++ /dev/null @@ -1,3 +0,0 @@ -#include "all.qh" - -#include diff --git a/qcsrc/server/bot/default/aim.qc b/qcsrc/server/bot/default/aim.qc index 15dfb0b9b..df874e3eb 100644 --- a/qcsrc/server/bot/default/aim.qc +++ b/qcsrc/server/bot/default/aim.qc @@ -9,7 +9,7 @@ #include "../../weapons/weaponsystem.qh" -#include "../../mutators/all.qh" +#include "../../mutators/_all.qh" // traces multiple trajectories to find one that will impact the target // 'end' vector is the place it aims for, diff --git a/qcsrc/server/bot/default/bot.qc b/qcsrc/server/bot/default/bot.qc index cab38143d..3f117de84 100644 --- a/qcsrc/server/bot/default/bot.qc +++ b/qcsrc/server/bot/default/bot.qc @@ -21,7 +21,7 @@ #include "../../race.qh" #include -#include "../../mutators/all.qh" +#include "../../mutators/_all.qh" #include "../../weapons/accuracy.qh" diff --git a/qcsrc/server/bot/null/_mod.inc b/qcsrc/server/bot/null/_mod.inc new file mode 100644 index 000000000..d40f4512e --- /dev/null +++ b/qcsrc/server/bot/null/_mod.inc @@ -0,0 +1,2 @@ +// generated file; do not modify +#include diff --git a/qcsrc/server/bot/null/_mod.qh b/qcsrc/server/bot/null/_mod.qh new file mode 100644 index 000000000..0449a1c43 --- /dev/null +++ b/qcsrc/server/bot/null/_mod.qh @@ -0,0 +1,2 @@ +// generated file; do not modify +#include diff --git a/qcsrc/server/cheats.qc b/qcsrc/server/cheats.qc index f31b3e5c2..a5858a9e0 100644 --- a/qcsrc/server/cheats.qc +++ b/qcsrc/server/cheats.qc @@ -4,7 +4,7 @@ #include "race.qh" #include "../common/triggers/teleporters.qh" -#include "mutators/all.qh" +#include "mutators/_all.qh" #include "weapons/tracing.qh" diff --git a/qcsrc/server/command/cmd.qc b/qcsrc/server/command/cmd.qc index 33f571665..19ee99a1a 100644 --- a/qcsrc/server/command/cmd.qc +++ b/qcsrc/server/command/cmd.qc @@ -12,7 +12,7 @@ #include "../scores.qh" #include "../teamplay.qh" -#include "../mutators/all.qh" +#include "../mutators/_all.qh" #ifdef SVQC #include diff --git a/qcsrc/server/command/sv_cmd.qc b/qcsrc/server/command/sv_cmd.qc index 720ad01f6..18a424a1d 100644 --- a/qcsrc/server/command/sv_cmd.qc +++ b/qcsrc/server/command/sv_cmd.qc @@ -18,7 +18,7 @@ #include "../bot/api.qh" -#include "../mutators/all.qh" +#include "../mutators/_all.qh" #include #include diff --git a/qcsrc/server/command/vote.qc b/qcsrc/server/command/vote.qc index f93e9c718..d03ed3489 100644 --- a/qcsrc/server/command/vote.qc +++ b/qcsrc/server/command/vote.qc @@ -10,7 +10,7 @@ #include "../round_handler.qh" #include "../scores.qh" -#include "../mutators/all.qh" +#include "../mutators/_all.qh" #include #include diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index d7e9b07c0..5ec8141e0 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -2,7 +2,7 @@ #include "bot/api.qh" #include "g_hook.qh" -#include "mutators/all.qh" +#include "mutators/_all.qh" #include "scores.qh" #include "spawnpoints.qh" #include "../common/state.qh" diff --git a/qcsrc/server/g_damage.qh b/qcsrc/server/g_damage.qh index f11c82c84..eb6a1cba0 100644 --- a/qcsrc/server/g_damage.qh +++ b/qcsrc/server/g_damage.qh @@ -17,7 +17,7 @@ #include "defs.qh" #include #include - #include "mutators/all.qh" + #include "mutators/_all.qh" #include #include #include diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index 27fe5c1ef..8f10ea9db 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -13,7 +13,7 @@ #include "g_hook.qh" #include "ipban.qh" #include "mapvoting.qh" -#include "mutators/all.qh" +#include "mutators/_all.qh" #include "race.qh" #include "scores.qh" #include "teamplay.qh" diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index a177cdc64..a88b4be56 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -4,7 +4,7 @@ #include "constants.qh" #include "g_hook.qh" #include "ipban.qh" -#include "mutators/all.qh" +#include "mutators/_all.qh" #include "../common/t_items.qh" #include "weapons/accuracy.qh" #include "weapons/csqcprojectile.qh" diff --git a/qcsrc/server/mutators/_all.inc b/qcsrc/server/mutators/_all.inc index 8bc63f720..65d709243 100644 --- a/qcsrc/server/mutators/_all.inc +++ b/qcsrc/server/mutators/_all.inc @@ -1,2 +1,4 @@ #include "_all.qh" #include "_mod.inc" + +#include "mutator/_all.inc" diff --git a/qcsrc/server/mutators/_all.qh b/qcsrc/server/mutators/_all.qh index 947026dd5..bae58a55c 100644 --- a/qcsrc/server/mutators/_all.qh +++ b/qcsrc/server/mutators/_all.qh @@ -1,2 +1,4 @@ #pragma once #include "_mod.qh" + +#include "mutator/_all.qh" diff --git a/qcsrc/server/mutators/_mod.inc b/qcsrc/server/mutators/_mod.inc index 3d2321896..582c2852f 100644 --- a/qcsrc/server/mutators/_mod.inc +++ b/qcsrc/server/mutators/_mod.inc @@ -1,2 +1,2 @@ // generated file; do not modify -#include +#include diff --git a/qcsrc/server/mutators/_mod.qh b/qcsrc/server/mutators/_mod.qh index 8feb1f37d..9ba0319fe 100644 --- a/qcsrc/server/mutators/_mod.qh +++ b/qcsrc/server/mutators/_mod.qh @@ -1,2 +1,2 @@ // generated file; do not modify -#include +#include diff --git a/qcsrc/server/mutators/all.inc b/qcsrc/server/mutators/all.inc deleted file mode 100644 index 1a80b4409..000000000 --- a/qcsrc/server/mutators/all.inc +++ /dev/null @@ -1,13 +0,0 @@ -#include "mutator/gamemode_assault.qc" -#include "mutator/gamemode_ca.qc" -#include "mutator/gamemode_ctf.qc" -#include "mutator/gamemode_cts.qc" -#include "mutator/gamemode_deathmatch.qc" -#include "mutator/gamemode_domination.qc" -#include "mutator/gamemode_freezetag.qc" -#include "mutator/gamemode_invasion.qc" -#include "mutator/gamemode_keepaway.qc" -#include "mutator/gamemode_keyhunt.qc" -#include "mutator/gamemode_lms.qc" -#include "mutator/gamemode_race.qc" -#include "mutator/gamemode_tdm.qc" diff --git a/qcsrc/server/mutators/all.qc b/qcsrc/server/mutators/all.qc deleted file mode 100644 index 0e8a607eb..000000000 --- a/qcsrc/server/mutators/all.qc +++ /dev/null @@ -1,85 +0,0 @@ -#include "all.qh" -#if defined(CSQC) -#elif defined(MENUQC) -#elif defined(SVQC) - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include "../weapons/accuracy.qh" - #include "../weapons/common.qh" - #include "../weapons/csqcprojectile.qh" - #include "../weapons/hitplot.qh" - #include "../weapons/selection.qh" - #include "../weapons/spawning.qh" - #include "../weapons/throwing.qh" - #include "../weapons/tracing.qh" - #include "../weapons/weaponstats.qh" - #include "../weapons/weaponsystem.qh" - #include - #include "../autocvars.qh" - #include "../constants.qh" - #include "../defs.qh" - #include - #include - #include "all.qh" - #include - #include - #include "../campaign.qh" - #include - #include - #include "../command/common.qh" - #include "../command/banning.qh" - #include "../command/radarmap.qh" - #include "../command/vote.qh" - #include "../command/getreplies.qh" - #include "../command/cmd.qh" - #include "../command/sv_cmd.qh" - #include - #include - #include - #include "../anticheat.qh" - #include "../cheats.qh" - #include - #include "../portals.qh" - #include "../g_hook.qh" - #include "../scores.qh" - #include "../spawnpoints.qh" - #include "../mapvoting.qh" - #include "../ipban.qh" - #include "../race.qh" - #include "../antilag.qh" - #include "../playerdemo.qh" - #include "../round_handler.qh" - #include "../item_key.qh" - #include "../pathlib/pathlib.qh" - #include -#endif - -#include "all.qh" - -STATIC_INIT_LATE(Gametype) { - Gametype g = MapInfo_CurrentGametype(); - if (g) { - for (string _s = g.m_mutators; _s != ""; _s = cdr(_s)) { - string s = car(_s); - FOREACH(Mutators, it.m_name == s, LAMBDA(Mutator_Add(it); break)); - } - } -} - -#define IMPLEMENTATION -#include "all.inc" -#undef IMPLEMENTATION diff --git a/qcsrc/server/mutators/all.qh b/qcsrc/server/mutators/all.qh deleted file mode 100644 index 4a1f2b353..000000000 --- a/qcsrc/server/mutators/all.qh +++ /dev/null @@ -1,6 +0,0 @@ -#pragma once - -#include "mutator.qh" -#include "gamemode.qh" - -#include "all.inc" diff --git a/qcsrc/server/mutators/gamemode.qh b/qcsrc/server/mutators/gamemode.qh index 85910ced8..81cb382b7 100644 --- a/qcsrc/server/mutators/gamemode.qh +++ b/qcsrc/server/mutators/gamemode.qh @@ -1,5 +1,73 @@ #pragma once +#include "mutator.qh" + +// TODO: trim + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include #include #include diff --git a/qcsrc/server/mutators/loader.qc b/qcsrc/server/mutators/loader.qc new file mode 100644 index 000000000..1784e72ec --- /dev/null +++ b/qcsrc/server/mutators/loader.qc @@ -0,0 +1,11 @@ +#include "loader.qh" + +STATIC_INIT_LATE(Gametype) { + Gametype g = MapInfo_CurrentGametype(); + if (g) { + for (string _s = g.m_mutators; _s != ""; _s = cdr(_s)) { + string s = car(_s); + FOREACH(Mutators, it.m_name == s, LAMBDA(Mutator_Add(it); break)); + } + } +} diff --git a/qcsrc/menu/command/all.qh b/qcsrc/server/mutators/loader.qh similarity index 100% rename from qcsrc/menu/command/all.qh rename to qcsrc/server/mutators/loader.qh diff --git a/qcsrc/server/mutators/mutator/_all.inc b/qcsrc/server/mutators/mutator/_all.inc index 8bc63f720..f72fb7539 100644 --- a/qcsrc/server/mutators/mutator/_all.inc +++ b/qcsrc/server/mutators/mutator/_all.inc @@ -1,2 +1,4 @@ #include "_all.qh" +#define IMPLEMENTATION #include "_mod.inc" +#undef IMPLEMENTATION diff --git a/qcsrc/server/mutators/mutator/_all.qh b/qcsrc/server/mutators/mutator/_all.qh index 947026dd5..d720bcf41 100644 --- a/qcsrc/server/mutators/mutator/_all.qh +++ b/qcsrc/server/mutators/mutator/_all.qh @@ -1,2 +1,3 @@ #pragma once -#include "_mod.qh" +// TODO: _mod.qh +#include "_mod.inc" diff --git a/qcsrc/server/portals.qc b/qcsrc/server/portals.qc index 8a40b1118..a9d9600a7 100644 --- a/qcsrc/server/portals.qc +++ b/qcsrc/server/portals.qc @@ -1,7 +1,7 @@ #include "portals.qh" #include "g_hook.qh" -#include "mutators/all.qh" +#include "mutators/_all.qh" #include "../common/constants.qh" #include "../common/deathtypes/all.qh" #include "../common/notifications/all.qh" diff --git a/qcsrc/server/scores.qc b/qcsrc/server/scores.qc index e3d5fd9d7..f2a6265ae 100644 --- a/qcsrc/server/scores.qc +++ b/qcsrc/server/scores.qc @@ -1,7 +1,7 @@ #include "scores.qh" #include "command/common.qh" -#include "mutators/all.qh" +#include "mutators/_all.qh" #include "../common/playerstats.qh" #include "../common/teams.qh" diff --git a/qcsrc/server/spawnpoints.qc b/qcsrc/server/spawnpoints.qc index 958b0bd6e..cc020b8a3 100644 --- a/qcsrc/server/spawnpoints.qc +++ b/qcsrc/server/spawnpoints.qc @@ -1,6 +1,6 @@ #include "spawnpoints.qh" -#include "mutators/all.qh" +#include "mutators/_all.qh" #include "g_world.qh" #include "race.qh" #include "../common/constants.qh" diff --git a/qcsrc/server/sv_main.qc b/qcsrc/server/sv_main.qc index 4a72bb1ae..15d426950 100644 --- a/qcsrc/server/sv_main.qc +++ b/qcsrc/server/sv_main.qc @@ -8,7 +8,7 @@ #include "command/common.qh" -#include "mutators/all.qh" +#include "mutators/_all.qh" #include "weapons/csqcprojectile.qh" #include "../common/constants.qh" diff --git a/qcsrc/server/teamplay.qc b/qcsrc/server/teamplay.qc index 56f85bd46..1d742375d 100644 --- a/qcsrc/server/teamplay.qc +++ b/qcsrc/server/teamplay.qc @@ -9,7 +9,7 @@ #include "command/vote.qh" -#include "mutators/all.qh" +#include "mutators/_all.qh" #include "../common/deathtypes/all.qh" #include "../common/gamemodes/all.qh" diff --git a/qcsrc/server/weapons/accuracy.qc b/qcsrc/server/weapons/accuracy.qc index 9efc4ce6a..c2ed3fedb 100644 --- a/qcsrc/server/weapons/accuracy.qc +++ b/qcsrc/server/weapons/accuracy.qc @@ -1,6 +1,6 @@ #include "accuracy.qh" -#include "../mutators/all.qh" +#include "../mutators/_all.qh" #include #include #include diff --git a/qcsrc/server/weapons/spawning.qc b/qcsrc/server/weapons/spawning.qc index faec22f30..89b4f26cf 100644 --- a/qcsrc/server/weapons/spawning.qc +++ b/qcsrc/server/weapons/spawning.qc @@ -1,7 +1,7 @@ #include "spawning.qh" #include "weaponsystem.qh" -#include "../mutators/all.qh" +#include "../mutators/_all.qh" #include #include diff --git a/qcsrc/server/weapons/throwing.qc b/qcsrc/server/weapons/throwing.qc index 7cc7580c1..398dcddcb 100644 --- a/qcsrc/server/weapons/throwing.qc +++ b/qcsrc/server/weapons/throwing.qc @@ -1,7 +1,7 @@ #include "throwing.qh" #include "weaponsystem.qh" -#include "../mutators/all.qh" +#include "../mutators/_all.qh" #include #include "../g_damage.qh" #include diff --git a/qcsrc/server/weapons/weaponsystem.qc b/qcsrc/server/weapons/weaponsystem.qc index c0ed81e68..f3851f5e3 100644 --- a/qcsrc/server/weapons/weaponsystem.qc +++ b/qcsrc/server/weapons/weaponsystem.qc @@ -3,7 +3,7 @@ #include "selection.qh" #include "../command/common.qh" -#include "../mutators/all.qh" +#include "../mutators/_all.qh" #include "../round_handler.qh" #include #include -- 2.39.2