From 6f37a8f8076a572097afb13de2c367a72717c927 Mon Sep 17 00:00:00 2001 From: TimePath Date: Sat, 2 May 2015 22:28:02 +1000 Subject: [PATCH] Make most server includes order insensitive --- qcsrc/client/_.qh | 4 +- .../{csqc_constants.qc => csqc_constants.qh} | 5 ++ qcsrc/common/buffs.qh | 1 + qcsrc/common/notifications.qh | 1 - qcsrc/dpdefs/csprogsdefs.qh | 6 +- qcsrc/dpdefs/dpextensions.qh | 2 +- qcsrc/server/_.qh | 12 +++ qcsrc/server/bot/aim.qc | 6 ++ qcsrc/server/bot/aim.qh | 1 + qcsrc/server/bot/bot.qc | 60 +++++++------- qcsrc/server/bot/bot.qh | 1 + qcsrc/server/bot/havocbot/havocbot.qc | 13 ++- qcsrc/server/bot/havocbot/role_keyhunt.qc | 12 ++- qcsrc/server/bot/havocbot/role_keyhunt.qh | 8 ++ qcsrc/server/bot/havocbot/role_onslaught.qc | 12 +++ qcsrc/server/bot/havocbot/role_onslaught.qh | 4 + qcsrc/server/bot/havocbot/roles.qc | 8 ++ qcsrc/server/bot/havocbot/roles.qh | 4 + qcsrc/server/bot/havocbot/scripting.qh | 5 ++ qcsrc/server/bot/navigation.qc | 10 +++ qcsrc/server/bot/navigation.qh | 1 + qcsrc/server/bot/scripting.qc | 75 ++--------------- qcsrc/server/bot/scripting.qh | 83 +++++++++++++++++++ qcsrc/server/bot/waypoints.qc | 12 +++ qcsrc/server/cheats.qc | 44 ++++------ qcsrc/server/cheats.qh | 10 +++ qcsrc/server/cl_client.qc | 17 +++- qcsrc/server/cl_client.qh | 13 +++ qcsrc/server/cl_impulse.qc | 9 ++ qcsrc/server/cl_physics.qc | 30 +------ qcsrc/server/cl_player.qc | 16 ++++ qcsrc/server/command/banning.qc | 22 ++--- qcsrc/server/command/banning.qh | 4 + qcsrc/server/command/cmd.qc | 66 ++++++++------- qcsrc/server/command/common.qc | 4 + qcsrc/server/command/getreplies.qc | 25 +++--- qcsrc/server/command/radarmap.qc | 19 ++--- qcsrc/server/command/radarmap.qh | 4 + qcsrc/server/command/sv_cmd.qc | 59 ++++++++----- qcsrc/server/command/vote.qc | 41 +++++---- qcsrc/server/command/vote.qh | 1 + qcsrc/server/csqceffects.qh | 4 + qcsrc/server/ent_cs.qc | 14 +--- qcsrc/server/func_breakable.qc | 8 ++ qcsrc/server/g_casings.qc | 12 +-- qcsrc/server/g_damage.qc | 49 +++++------ qcsrc/server/g_hook.qc | 35 ++++---- qcsrc/server/g_lights.qc | 4 + qcsrc/server/g_models.qc | 18 ++-- qcsrc/server/g_subs.qc | 5 ++ qcsrc/server/g_triggers.qc | 6 ++ qcsrc/server/g_violence.qc | 1 + qcsrc/server/g_world.qc | 70 ++++++++-------- qcsrc/server/g_world.qh | 11 +++ qcsrc/server/ipban.qc | 22 +++-- qcsrc/server/item_key.qc | 19 ++--- qcsrc/server/mapvoting.qc | 26 +++--- qcsrc/server/mapvoting.qh | 3 + qcsrc/server/miscfunctions.qc | 58 ++++++------- qcsrc/server/miscfunctions.qh | 38 +++++++++ qcsrc/server/mutators/base.qc | 3 + qcsrc/server/mutators/gamemode.qh | 49 +++++++++++ qcsrc/server/mutators/gamemode_assault.qc | 7 ++ qcsrc/server/mutators/gamemode_ca.qc | 8 +- qcsrc/server/mutators/gamemode_ctf.qc | 10 +++ qcsrc/server/mutators/gamemode_ctf.qh | 2 + qcsrc/server/mutators/gamemode_cts.qc | 7 ++ qcsrc/server/mutators/gamemode_domination.qc | 5 ++ qcsrc/server/mutators/gamemode_freezetag.qc | 10 +-- qcsrc/server/mutators/gamemode_freezetag.qh | 11 +++ qcsrc/server/mutators/gamemode_invasion.qc | 8 ++ qcsrc/server/mutators/gamemode_keepaway.qc | 5 ++ qcsrc/server/mutators/gamemode_keepaway.qh | 3 + qcsrc/server/mutators/gamemode_keyhunt.qc | 6 +- qcsrc/server/mutators/gamemode_keyhunt.qh | 5 ++ qcsrc/server/mutators/gamemode_lms.qc | 8 ++ qcsrc/server/mutators/gamemode_nexball.qc | 7 ++ qcsrc/server/mutators/gamemode_onslaught.qc | 4 + qcsrc/server/mutators/gamemode_race.qc | 7 ++ qcsrc/server/mutators/gamemode_tdm.qc | 4 + qcsrc/server/mutators/mutator.qh | 47 +++++++++++ qcsrc/server/mutators/mutator_bloodloss.qc | 4 + qcsrc/server/mutators/mutator_buffs.qc | 9 ++ qcsrc/server/mutators/mutator_campcheck.qc | 6 ++ qcsrc/server/mutators/mutator_dodging.qc | 6 ++ qcsrc/server/mutators/mutator_instagib.qc | 7 ++ .../server/mutators/mutator_invincibleproj.qc | 4 + qcsrc/server/mutators/mutator_melee_only.qc | 4 + qcsrc/server/mutators/mutator_midair.qc | 4 + qcsrc/server/mutators/mutator_multijump.qc | 6 ++ qcsrc/server/mutators/mutator_nades.qc | 13 +++ qcsrc/server/mutators/mutator_new_toys.qc | 4 + qcsrc/server/mutators/mutator_nix.qc | 4 + qcsrc/server/mutators/mutator_overkill.qc | 9 ++ .../server/mutators/mutator_physical_items.qc | 4 + qcsrc/server/mutators/mutator_pinata.qc | 4 + .../server/mutators/mutator_random_gravity.qc | 4 + qcsrc/server/mutators/mutator_rocketflying.qc | 4 + .../mutators/mutator_spawn_near_teammate.qc | 4 + qcsrc/server/mutators/mutator_superspec.qc | 4 + qcsrc/server/mutators/mutator_touchexplode.qc | 4 + qcsrc/server/mutators/mutator_vampire.qc | 4 + qcsrc/server/mutators/sandbox.qc | 4 + qcsrc/server/pathlib.qc | 70 ++-------------- qcsrc/server/pathlib.qh | 48 +++++++++++ qcsrc/server/pathlib/costs.qc | 2 + qcsrc/server/pathlib/debug.qc | 3 + qcsrc/server/pathlib/expandnode.qc | 3 + qcsrc/server/pathlib/main.qc | 6 ++ qcsrc/server/pathlib/main.qh | 5 ++ qcsrc/server/pathlib/movenode.qc | 5 ++ qcsrc/server/pathlib/path_waypoint.qc | 5 ++ qcsrc/server/pathlib/pathlib.qh | 6 -- qcsrc/server/pathlib/utility.qc | 4 + qcsrc/server/pathlib/utility.qh | 6 ++ qcsrc/server/portals.qc | 34 ++++---- qcsrc/server/progs.src | 16 ++++ qcsrc/server/race.qc | 36 +++++++- qcsrc/server/race.qh | 23 +++++ qcsrc/server/round_handler.qc | 14 ++-- qcsrc/server/scores.qc | 6 ++ qcsrc/server/scores.qh | 2 + qcsrc/server/scores_rules.qc | 17 ++-- qcsrc/server/scores_rules.qh | 8 ++ qcsrc/server/secret.qc | 13 ++- qcsrc/server/spawnpoints.qc | 26 +++--- qcsrc/server/steerlib.qc | 2 - qcsrc/server/steerlib.qh | 10 +++ qcsrc/server/sv_main.qc | 51 +++++++----- qcsrc/server/t_halflife.qc | 15 ++-- qcsrc/server/t_items.qc | 15 ++-- qcsrc/server/t_items.qh | 4 + qcsrc/server/t_jumppads.qc | 12 +++ qcsrc/server/t_plats.qc | 42 ++++++---- qcsrc/server/t_quake.qc | 2 + qcsrc/server/t_quake3.qc | 2 + qcsrc/server/t_swamp.qc | 4 +- qcsrc/server/t_teleporters.qc | 4 +- qcsrc/server/target_music.qc | 11 +-- qcsrc/server/target_spawn.qc | 12 +-- qcsrc/server/teamplay.qc | 15 ++++ qcsrc/server/tturrets/system/system_main.qc | 5 ++ qcsrc/server/tturrets/units/unit_ewheel.qc | 2 + .../server/tturrets/units/unit_machinegun.qc | 2 + qcsrc/server/tturrets/units/unit_phaser.qc | 2 + .../tturrets/units/unit_targettrigger.qc | 2 + qcsrc/server/tturrets/units/unit_tessla.qc | 2 + qcsrc/server/tturrets/units/unit_walker.qc | 6 ++ qcsrc/server/vehicles/bumblebee.qc | 1 + qcsrc/server/vehicles/racer.qc | 2 + qcsrc/server/vehicles/vehicles.qc | 9 ++ qcsrc/test/compilationunit.sh | 11 ++- 152 files changed, 1389 insertions(+), 679 deletions(-) rename qcsrc/client/{csqc_constants.qc => csqc_constants.qh} (98%) create mode 100644 qcsrc/server/_.qh create mode 100644 qcsrc/server/bot/havocbot/role_keyhunt.qh create mode 100644 qcsrc/server/bot/havocbot/role_onslaught.qh create mode 100644 qcsrc/server/bot/havocbot/roles.qh create mode 100644 qcsrc/server/bot/havocbot/scripting.qh create mode 100644 qcsrc/server/bot/scripting.qh create mode 100644 qcsrc/server/cl_client.qh create mode 100644 qcsrc/server/csqceffects.qh create mode 100644 qcsrc/server/mutators/gamemode.qh create mode 100644 qcsrc/server/mutators/gamemode_freezetag.qh create mode 100644 qcsrc/server/mutators/mutator.qh create mode 100644 qcsrc/server/pathlib.qh create mode 100644 qcsrc/server/pathlib/main.qh create mode 100644 qcsrc/server/pathlib/utility.qh create mode 100644 qcsrc/server/scores_rules.qh create mode 100644 qcsrc/server/steerlib.qh diff --git a/qcsrc/client/_.qh b/qcsrc/client/_.qh index 8b811bceb..c8ff79d58 100644 --- a/qcsrc/client/_.qh +++ b/qcsrc/client/_.qh @@ -1,5 +1,5 @@ -#ifndef __H -#define __H +#ifndef CLIENT___H +#define CLIENT___H #include "autocvars.qh" #include "defs.qh" diff --git a/qcsrc/client/csqc_constants.qc b/qcsrc/client/csqc_constants.qh similarity index 98% rename from qcsrc/client/csqc_constants.qc rename to qcsrc/client/csqc_constants.qh index f11c31c62..09d217bc2 100644 --- a/qcsrc/client/csqc_constants.qc +++ b/qcsrc/client/csqc_constants.qh @@ -1,3 +1,6 @@ +#ifndef CSQC_CONSTANTS +#define CSQC_CONSTANTS + // MenuQC redefines world, change define it here to be safe #define world world @@ -141,3 +144,5 @@ const int CAMERA_FREE = 1; const int CAMERA_CHASE = 2; const int EF_NOMODELFLAGS = 8388608; + +#endif diff --git a/qcsrc/common/buffs.qh b/qcsrc/common/buffs.qh index 8003fd8b9..f34373263 100644 --- a/qcsrc/common/buffs.qh +++ b/qcsrc/common/buffs.qh @@ -1,6 +1,7 @@ #ifndef BUFFS_H #define BUFFS_H +#include "teams.qh" #include "util.qh" entity Buff_Type_first; diff --git a/qcsrc/common/notifications.qh b/qcsrc/common/notifications.qh index dda68d791..83526614a 100644 --- a/qcsrc/common/notifications.qh +++ b/qcsrc/common/notifications.qh @@ -1,7 +1,6 @@ #ifndef NOTIFICATIONS_H #define NOTIFICATIONS_H -#include "autocvars.qh" #include "constants.qh" #include "teams.qh" #include "util.qh" diff --git a/qcsrc/dpdefs/csprogsdefs.qh b/qcsrc/dpdefs/csprogsdefs.qh index 4effe6492..136d7ca1d 100644 --- a/qcsrc/dpdefs/csprogsdefs.qh +++ b/qcsrc/dpdefs/csprogsdefs.qh @@ -267,8 +267,8 @@ const vector VEC_M1 = '-1 -1 -1'; //const float M_PI = 3.14159265358979323846; -vector VEC_HULL_MIN = '-16 -16 -24'; -vector VEC_HULL_MAX = '16 16 32'; +const vector VEC_HULL_MIN = '-16 -16 -24'; +const vector VEC_HULL_MAX = '16 16 32'; // Quake Temporary Entity Constants const int TE_SPIKE = 0; @@ -1083,7 +1083,7 @@ float PRECACHE_PIC_MIPMAP = 8; // mipmap the texture for possibly better downsca //idea: LordHavoc //darkplaces implementation: LordHavoc //constant definitions: -float MOVE_WORLDONLY = 3; +const float MOVE_WORLDONLY = 3; //description: //allows traces to hit only world (ignoring all entities, unlike MOVE_NOMONSTERS which hits all bmodels), use as the nomonsters parameter to trace functions diff --git a/qcsrc/dpdefs/dpextensions.qh b/qcsrc/dpdefs/dpextensions.qh index 109e9195b..47fdcc180 100644 --- a/qcsrc/dpdefs/dpextensions.qh +++ b/qcsrc/dpdefs/dpextensions.qh @@ -1132,7 +1132,7 @@ float MOVE_HITMODEL = 4; //idea: LordHavoc //darkplaces implementation: LordHavoc //constant definitions: -float MOVE_WORLDONLY = 3; +const float MOVE_WORLDONLY = 3; //description: //allows traces to hit only world (ignoring all entities, unlike MOVE_NOMONSTERS which hits all bmodels), use as the nomonsters parameter to trace functions diff --git a/qcsrc/server/_.qh b/qcsrc/server/_.qh new file mode 100644 index 000000000..6438a1094 --- /dev/null +++ b/qcsrc/server/_.qh @@ -0,0 +1,12 @@ +#ifndef SERVER___H +#define SERVER___H + +#include "autocvars.qh" +#include "constants.qh" +#include "defs.qh" +#include "miscfunctions.qh" + +#include "../dpdefs/progsdefs.qh" +#include "../dpdefs/dpextensions.qh" + +#endif diff --git a/qcsrc/server/bot/aim.qc b/qcsrc/server/bot/aim.qc index b529ed1c3..b68fc6c1a 100644 --- a/qcsrc/server/bot/aim.qc +++ b/qcsrc/server/bot/aim.qc @@ -1,3 +1,9 @@ +#include "aim.qh" +#include "../_.qh" + +#include "bot.qh" + +#include "../mutators/mutators_include.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/aim.qh b/qcsrc/server/bot/aim.qh index fb191a91c..d1cbd0d62 100644 --- a/qcsrc/server/bot/aim.qh +++ b/qcsrc/server/bot/aim.qh @@ -86,6 +86,7 @@ vector shotdir; * Functions */ +float lag_additem(float t, float f1, float f2, entity e1, vector v1, vector v2, vector v3, vector v4); void lag_update(); void bot_lagfunc(float t, float f1, float f2, entity e1, vector v1, vector v2, vector v3, vector v4); diff --git a/qcsrc/server/bot/bot.qc b/qcsrc/server/bot/bot.qc index 0acd32993..068ca61ef 100644 --- a/qcsrc/server/bot/bot.qc +++ b/qcsrc/server/bot/bot.qc @@ -1,37 +1,41 @@ -#if defined(CSQC) -#elif defined(MENUQC) -#elif defined(SVQC) - #include "../../dpdefs/progsdefs.qh" - #include "../../dpdefs/dpextensions.qh" - #include "../../warpzonelib/common.qh" - #include "../../warpzonelib/util_server.qh" - #include "../../common/constants.qh" - #include "../../common/teams.qh" - #include "../../common/util.qh" - #include "../../common/weapons/weapons.qh" - #include "../weapons/accuracy.qh" - #include "../t_items.qh" - #include "../autocvars.qh" - #include "../constants.qh" - #include "../defs.qh" - #include "../mutators/mutators_include.qh" - #include "../campaign.qh" - #include "../../common/mapinfo.qh" - #include "../../csqcmodellib/sv_model.qh" - #include "../antilag.qh" -#endif - #include "bot.qh" +#include "../_.qh" + #include "aim.qh" #include "navigation.qh" +#include "scripting.qh" #include "waypoints.qh" -#include "aim.qc" -#include "navigation.qc" -#include "waypoints.qc" -#include "scripting.qc" +#include "havocbot/havocbot.qh" +#include "havocbot/scripting.qh" + +#include "../antilag.qh" +#include "../autocvars.qh" +#include "../campaign.qh" +#include "../cl_client.qh" +#include "../constants.qh" +#include "../defs.qh" +#include "../race.qh" +#include "../t_items.qh" + +#include "../mutators/mutators_include.qh" + +#include "../weapons/accuracy.qh" + +#include "../../common/constants.qh" +#include "../../common/mapinfo.qh" +#include "../../common/teams.qh" +#include "../../common/util.qh" + +#include "../../common/weapons/weapons.qh" + +#include "../../csqcmodellib/sv_model.qh" + +#include "../../dpdefs/dpextensions.qh" +#include "../../dpdefs/progsdefs.qh" -#include "havocbot/havocbot.qc" +#include "../../warpzonelib/common.qh" +#include "../../warpzonelib/util_server.qh" entity bot_spawn() { diff --git a/qcsrc/server/bot/bot.qh b/qcsrc/server/bot/bot.qh index bcae58dc1..ac89f06a7 100644 --- a/qcsrc/server/bot/bot.qh +++ b/qcsrc/server/bot/bot.qh @@ -91,6 +91,7 @@ float bot_ignore_bots; // let bots not attack other bots (only works in non-team */ entity bot_spawn(); +float bot_fixcount(); void bot_think(); void bot_setnameandstuff(); diff --git a/qcsrc/server/bot/havocbot/havocbot.qc b/qcsrc/server/bot/havocbot/havocbot.qc index f05df2886..687dcf5fe 100644 --- a/qcsrc/server/bot/havocbot/havocbot.qc +++ b/qcsrc/server/bot/havocbot/havocbot.qc @@ -1,8 +1,15 @@ #include "havocbot.qh" +#include "../../_.qh" -#include "role_onslaught.qc" -#include "role_keyhunt.qc" -#include "roles.qc" +#include "../aim.qh" +#include "../bot.qh" +#include "../navigation.qh" +#include "../scripting.qh" +#include "../waypoints.qh" + +#include "../../../common/constants.qh" + +#include "../../../warpzonelib/common.qh" void havocbot_ai() { diff --git a/qcsrc/server/bot/havocbot/role_keyhunt.qc b/qcsrc/server/bot/havocbot/role_keyhunt.qc index 3b641d9ce..6b4b1012a 100644 --- a/qcsrc/server/bot/havocbot/role_keyhunt.qc +++ b/qcsrc/server/bot/havocbot/role_keyhunt.qc @@ -1,10 +1,18 @@ +#include "role_keyhunt.qh" +#include "../../_.qh" + +#include "havocbot.qh" + +#include "../bot.qh" +#include "../navigation.qh" + +#include "../../mutators/mutators_include.qh" + void() havocbot_role_kh_carrier; void() havocbot_role_kh_defense; void() havocbot_role_kh_offense; void() havocbot_role_kh_freelancer; -entity kh_worldkeylist; -.entity kh_worldkeynext; void havocbot_goalrating_kh(float ratingscale_team, float ratingscale_dropped, float ratingscale_enemy) { diff --git a/qcsrc/server/bot/havocbot/role_keyhunt.qh b/qcsrc/server/bot/havocbot/role_keyhunt.qh new file mode 100644 index 000000000..f3136c630 --- /dev/null +++ b/qcsrc/server/bot/havocbot/role_keyhunt.qh @@ -0,0 +1,8 @@ +#ifndef ROLE_KEYHUNT_H +#define ROLE_KEYHUNT_H + +entity kh_worldkeylist; +.entity kh_worldkeynext; + +void havocbot_chooserole_kh(); +#endif diff --git a/qcsrc/server/bot/havocbot/role_onslaught.qc b/qcsrc/server/bot/havocbot/role_onslaught.qc index 119ea83c8..13c9cdc03 100644 --- a/qcsrc/server/bot/havocbot/role_onslaught.qc +++ b/qcsrc/server/bot/havocbot/role_onslaught.qc @@ -1,3 +1,15 @@ +#include "../../_.qh" + +#include "havocbot.qh" + +#include "../bot.qh" +#include "../navigation.qh" +#include "../waypoints.qh" + +#include "../../mutators/mutators_include.qh" + +#include "../../../common/teams.qh" + const int HAVOCBOT_ONS_ROLE_NONE = 0; const int HAVOCBOT_ONS_ROLE_DEFENSE = 2; const int HAVOCBOT_ONS_ROLE_ASSISTANT = 4; diff --git a/qcsrc/server/bot/havocbot/role_onslaught.qh b/qcsrc/server/bot/havocbot/role_onslaught.qh new file mode 100644 index 000000000..3fca678fd --- /dev/null +++ b/qcsrc/server/bot/havocbot/role_onslaught.qh @@ -0,0 +1,4 @@ +#ifndef ROLE_ONSLAUGHT_H +#define ROLE_ONSLAUGHT_H +void havocbot_chooserole_ons(); +#endif diff --git a/qcsrc/server/bot/havocbot/roles.qc b/qcsrc/server/bot/havocbot/roles.qc index af219b8ec..2f1a8d719 100644 --- a/qcsrc/server/bot/havocbot/roles.qc +++ b/qcsrc/server/bot/havocbot/roles.qc @@ -1,3 +1,11 @@ +#include "../../_.qh" + +#include "havocbot.qh" +#include "role_keyhunt.qh" +#include "role_onslaught.qh" + +#include "../bot.qh" +#include "../navigation.qh" .float max_armorvalue; .float havocbot_role_timeout; diff --git a/qcsrc/server/bot/havocbot/roles.qh b/qcsrc/server/bot/havocbot/roles.qh new file mode 100644 index 000000000..cfabf0534 --- /dev/null +++ b/qcsrc/server/bot/havocbot/roles.qh @@ -0,0 +1,4 @@ +#ifndef ROLES_H +#define ROLES_H +void havocbot_goalrating_controlpoints(float ratingscale, vector org, float sradius); +#endif diff --git a/qcsrc/server/bot/havocbot/scripting.qh b/qcsrc/server/bot/havocbot/scripting.qh new file mode 100644 index 000000000..c09dbdeac --- /dev/null +++ b/qcsrc/server/bot/havocbot/scripting.qh @@ -0,0 +1,5 @@ +#ifndef HAVOCBOT_SCRIPTING_H +#define HAVOCBOT_SCRIPTING_H + +void bot_clearqueue(entity bot); +#endif diff --git a/qcsrc/server/bot/navigation.qc b/qcsrc/server/bot/navigation.qc index d80f8336c..018a6eb06 100644 --- a/qcsrc/server/bot/navigation.qc +++ b/qcsrc/server/bot/navigation.qc @@ -1,3 +1,13 @@ +#include "navigation.qh" +#include "../_.qh" + +#include "bot.qh" +#include "waypoints.qh" + +#include "../t_items.qh" + +#include "../../common/constants.qh" + void bot_debug(string input) { switch(autocvar_bot_debug) diff --git a/qcsrc/server/bot/navigation.qh b/qcsrc/server/bot/navigation.qh index 08e1c53ac..cf4a5ce5b 100644 --- a/qcsrc/server/bot/navigation.qh +++ b/qcsrc/server/bot/navigation.qh @@ -76,4 +76,5 @@ void navigation_unstuck(); void botframe_updatedangerousobjects(float maxupdate); entity navigation_findnearestwaypoint(entity ent, float walkfromwp); +float navigation_waypoint_will_link(vector v, vector org, entity ent, float walkfromwp, float bestdist); #endif diff --git a/qcsrc/server/bot/scripting.qc b/qcsrc/server/bot/scripting.qc index c9a86d56a..6aedb6040 100644 --- a/qcsrc/server/bot/scripting.qc +++ b/qcsrc/server/bot/scripting.qc @@ -1,3 +1,8 @@ +#include "scripting.qh" +#include "../_.qh" + +#include "bot.qh" + .float bot_cmdqueuebuf_allocated; .float bot_cmdqueuebuf; .float bot_cmdqueuebuf_start; @@ -137,68 +142,6 @@ entity bot_getplace(string placename) } -// NOTE: New commands should be added here. Do not forget to update BOT_CMD_COUNTER -const int BOT_CMD_NULL = 0; -const int BOT_CMD_PAUSE = 1; -const int BOT_CMD_CONTINUE = 2; -const int BOT_CMD_WAIT = 3; -const int BOT_CMD_TURN = 4; -const int BOT_CMD_MOVETO = 5; -const int BOT_CMD_RESETGOAL = 6; // Not implemented yet -const int BOT_CMD_CC = 7; -const int BOT_CMD_IF = 8; -const int BOT_CMD_ELSE = 9; -const int BOT_CMD_FI = 10; -const int BOT_CMD_RESETAIM = 11; -const int BOT_CMD_AIM = 12; -const int BOT_CMD_PRESSKEY = 13; -const int BOT_CMD_RELEASEKEY = 14; -const int BOT_CMD_SELECTWEAPON = 15; -const int BOT_CMD_IMPULSE = 16; -const int BOT_CMD_WAIT_UNTIL = 17; -const int BOT_CMD_MOVETOTARGET = 18; -const int BOT_CMD_AIMTARGET = 19; -const int BOT_CMD_BARRIER = 20; -const int BOT_CMD_CONSOLE = 21; -const int BOT_CMD_SOUND = 22; -const int BOT_CMD_DEBUG_ASSERT_CANFIRE = 23; -const int BOT_CMD_WHILE = 24; // TODO: Not implemented yet -const int BOT_CMD_WEND = 25; // TODO: Not implemented yet -const int BOT_CMD_CHASE = 26; // TODO: Not implemented yet - -const int BOT_CMD_COUNTER = 24; // Update this value if you add/remove a command - -// NOTE: Following commands should be implemented on the bot ai -// If a new command should be handled by the target ai(s) please declare it here -.float(vector) cmd_moveto; -.float() cmd_resetgoal; - -// -const int BOT_CMD_PARAMETER_NONE = 0; -const int BOT_CMD_PARAMETER_FLOAT = 1; -const int BOT_CMD_PARAMETER_STRING = 2; -const int BOT_CMD_PARAMETER_VECTOR = 3; - -float bot_cmds_initialized; -int bot_cmd_parm_type[BOT_CMD_COUNTER]; -string bot_cmd_string[BOT_CMD_COUNTER]; - -// Bots command queue -entity bot_cmd; // global current command -.entity bot_cmd_current; // current command of this bot - -.float is_bot_cmd; // Tells if the entity is a bot command -.float bot_cmd_index; // Position of the command in the queue -.int bot_cmd_type; // If of command (see the BOT_CMD_* defines) -.float bot_cmd_parm_float; // Field to store a float parameter -.string bot_cmd_parm_string; // Field to store a string parameter -.vector bot_cmd_parm_vector; // Field to store a vector parameter - -float bot_barriertime; -.float bot_barrier; - -.float bot_cmd_execution_index; // Position in the queue of the command to be executed - // Initialize global commands list // NOTE: New commands should be initialized here void bot_commands_init() @@ -529,14 +472,6 @@ void bot_list_commands() // Commands code .int bot_exec_status; -#define BOT_EXEC_STATUS_IDLE 0 -#define BOT_EXEC_STATUS_PAUSED 1 -#define BOT_EXEC_STATUS_WAITING 2 - -#define CMD_STATUS_EXECUTING 0 -#define CMD_STATUS_FINISHED 1 -#define CMD_STATUS_ERROR 2 - void SV_ParseClientCommand(string s); float bot_cmd_cc() { diff --git a/qcsrc/server/bot/scripting.qh b/qcsrc/server/bot/scripting.qh new file mode 100644 index 000000000..d5cdda9d6 --- /dev/null +++ b/qcsrc/server/bot/scripting.qh @@ -0,0 +1,83 @@ +#ifndef BOT_SCRIPTING_H +#define BOT_SCRIPTING_H + +#define BOT_EXEC_STATUS_IDLE 0 +#define BOT_EXEC_STATUS_PAUSED 1 +#define BOT_EXEC_STATUS_WAITING 2 + +#define CMD_STATUS_EXECUTING 0 +#define CMD_STATUS_FINISHED 1 +#define CMD_STATUS_ERROR 2 + + +// NOTE: New commands should be added here. Do not forget to update BOT_CMD_COUNTER +const int BOT_CMD_NULL = 0; +const int BOT_CMD_PAUSE = 1; +const int BOT_CMD_CONTINUE = 2; +const int BOT_CMD_WAIT = 3; +const int BOT_CMD_TURN = 4; +const int BOT_CMD_MOVETO = 5; +const int BOT_CMD_RESETGOAL = 6; // Not implemented yet +const int BOT_CMD_CC = 7; +const int BOT_CMD_IF = 8; +const int BOT_CMD_ELSE = 9; +const int BOT_CMD_FI = 10; +const int BOT_CMD_RESETAIM = 11; +const int BOT_CMD_AIM = 12; +const int BOT_CMD_PRESSKEY = 13; +const int BOT_CMD_RELEASEKEY = 14; +const int BOT_CMD_SELECTWEAPON = 15; +const int BOT_CMD_IMPULSE = 16; +const int BOT_CMD_WAIT_UNTIL = 17; +const int BOT_CMD_MOVETOTARGET = 18; +const int BOT_CMD_AIMTARGET = 19; +const int BOT_CMD_BARRIER = 20; +const int BOT_CMD_CONSOLE = 21; +const int BOT_CMD_SOUND = 22; +const int BOT_CMD_DEBUG_ASSERT_CANFIRE = 23; +const int BOT_CMD_WHILE = 24; // TODO: Not implemented yet +const int BOT_CMD_WEND = 25; // TODO: Not implemented yet +const int BOT_CMD_CHASE = 26; // TODO: Not implemented yet + +const int BOT_CMD_COUNTER = 24; // Update this value if you add/remove a command + +// NOTE: Following commands should be implemented on the bot ai +// If a new command should be handled by the target ai(s) please declare it here +.float(vector) cmd_moveto; +.float() cmd_resetgoal; + +// +const int BOT_CMD_PARAMETER_NONE = 0; +const int BOT_CMD_PARAMETER_FLOAT = 1; +const int BOT_CMD_PARAMETER_STRING = 2; +const int BOT_CMD_PARAMETER_VECTOR = 3; + +float bot_cmds_initialized; +int bot_cmd_parm_type[BOT_CMD_COUNTER]; +string bot_cmd_string[BOT_CMD_COUNTER]; + +// Bots command queue +entity bot_cmd; // global current command +.entity bot_cmd_current; // current command of this bot + +.float is_bot_cmd; // Tells if the entity is a bot command +.float bot_cmd_index; // Position of the command in the queue +.int bot_cmd_type; // If of command (see the BOT_CMD_* defines) +.float bot_cmd_parm_float; // Field to store a float parameter +.string bot_cmd_parm_string; // Field to store a string parameter +.vector bot_cmd_parm_vector; // Field to store a vector parameter + +float bot_barriertime; +.float bot_barrier; + +.float bot_cmd_execution_index; // Position in the queue of the command to be executed + + +void bot_resetqueues(); +void bot_queuecommand(entity bot, string cmdstring); +void bot_cmdhelp(string scmd); +void bot_list_commands(); +float bot_execute_commands(); +entity find_bot_by_name(string name); +entity find_bot_by_number(float number); +#endif diff --git a/qcsrc/server/bot/waypoints.qc b/qcsrc/server/bot/waypoints.qc index 9d78cedc5..8cd7ef3f5 100644 --- a/qcsrc/server/bot/waypoints.qc +++ b/qcsrc/server/bot/waypoints.qc @@ -1,3 +1,15 @@ +#include "waypoints.qh" +#include "../_.qh" + +#include "bot.qh" +#include "navigation.qh" + +#include "../antilag.qh" + +#include "../../common/constants.qh" + +#include "../../warpzonelib/util_server.qh" + // create a new spawnfunc_waypoint and automatically link it to other waypoints, and link // them back to it as well // (suitable for spawnfunc_waypoint editor) diff --git a/qcsrc/server/cheats.qc b/qcsrc/server/cheats.qc index 657ec4d7f..d1e72a5ec 100644 --- a/qcsrc/server/cheats.qc +++ b/qcsrc/server/cheats.qc @@ -1,26 +1,26 @@ #include "cheats.qh" +#include "_.qh" + #include "g_damage.qh" #include "race.qh" #include "t_teleporters.qh" -#if defined(CSQC) -#elif defined(MENUQC) -#elif defined(SVQC) - #include "../dpdefs/progsdefs.qh" - #include "../dpdefs/dpextensions.qh" - #include "../warpzonelib/anglestransform.qh" - #include "../warpzonelib/util_server.qh" - #include "../common/constants.qh" - #include "../common/util.qh" - #include "../common/monsters/monsters.qh" - #include "../common/weapons/weapons.qh" - #include "weapons/tracing.qh" - #include "autocvars.qh" - #include "defs.qh" - #include "../common/deathtypes.qh" - #include "mutators/mutators_include.qh" - #include "../csqcmodellib/sv_model.qh" -#endif +#include "mutators/mutators_include.qh" + +#include "weapons/tracing.qh" + +#include "../common/constants.qh" +#include "../common/deathtypes.qh" +#include "../common/util.qh" + +#include "../common/monsters/monsters.qh" + +#include "../common/weapons/weapons.qh" + +#include "../csqcmodellib/sv_model.qh" + +#include "../warpzonelib/anglestransform.qh" +#include "../warpzonelib/util_server.qh" void CopyBody(float keepvelocity); @@ -40,15 +40,7 @@ void Drag_MoveDrag(entity from, entity to) { } .float maycheat; float gamestart_sv_cheats; -const float CHIMPULSE_SPEEDRUN_INIT = 30; -const float CHIMPULSE_GIVE_ALL = 99; -const float CHIMPULSE_CLONE_MOVING = 140; -const float CHIMPULSE_SPEEDRUN = 141; -const float CHIMPULSE_CLONE_STANDING = 142; -const float CHIMPULSE_TELEPORT = 143; -const float CHIMPULSE_R00T = 148; -const float CHRAME_DRAG = 8; void CheatInit() { diff --git a/qcsrc/server/cheats.qh b/qcsrc/server/cheats.qh index 625a304bd..f200c4c86 100644 --- a/qcsrc/server/cheats.qh +++ b/qcsrc/server/cheats.qh @@ -13,5 +13,15 @@ float CheatImpulse(float i); float CheatCommand(float argc); float CheatFrame(); +const float CHIMPULSE_SPEEDRUN_INIT = 30; +const float CHIMPULSE_GIVE_ALL = 99; +const float CHIMPULSE_CLONE_MOVING = 140; +const float CHIMPULSE_SPEEDRUN = 141; +const float CHIMPULSE_CLONE_STANDING = 142; +const float CHIMPULSE_TELEPORT = 143; +const float CHIMPULSE_R00T = 148; + +const float CHRAME_DRAG = 8; + void Drag_MoveDrag(entity from, entity to); // call this from CopyBody #endif diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index c0a8bde51..61565b767 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -1,5 +1,8 @@ +#include "cl_client.qh" + #include "waypointsprites.qh" +#include "anticheat.qh" #include "cl_impulse.qh" #include "cl_player.qh" #include "ent_cs.qh" @@ -10,10 +13,23 @@ #include "teamplay.qh" #include "playerdemo.qh" #include "secret.qh" +#include "spawnpoints.qh" +#include "g_damage.qh" +#include "g_hook.qh" +#include "t_teleporters.qh" +#include "command/common.qh" +#include "cheats.qh" +#include "g_world.qh" +#include "race.qh" +#include "antilag.qh" +#include "campaign.qh" +#include "command/common.qh" #include "bot/bot.qh" #include "bot/navigation.qh" +#include "vehicles/vehicles_def.qh" + #include "weapons/hitplot.qh" #include "weapons/weaponsystem.qh" @@ -23,7 +39,6 @@ #include "../warpzonelib/server.qh" -float c1, c2, c3, c4; void send_CSQC_teamnagger() { WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); diff --git a/qcsrc/server/cl_client.qh b/qcsrc/server/cl_client.qh new file mode 100644 index 000000000..213a02945 --- /dev/null +++ b/qcsrc/server/cl_client.qh @@ -0,0 +1,13 @@ +#ifndef CL_CLIENT_H +#define CL_CLIENT_H +float c1, c2, c3, c4; + +void play_countdown(float finished, string samp); + +float CalcRotRegen(float current, float regenstable, float regenfactor, float regenlinear, float regenframetime, float rotstable, float rotfactor, float rotlinear, float rotframetime, float limit); + +float Spectate(entity pl); + +void CTS_ClientKill (entity e); + +#endif diff --git a/qcsrc/server/cl_impulse.qc b/qcsrc/server/cl_impulse.qc index b65a660f0..8b40f9cf9 100644 --- a/qcsrc/server/cl_impulse.qc +++ b/qcsrc/server/cl_impulse.qc @@ -1,8 +1,17 @@ +#include "_.qh" #include "round_handler.qh" #include "bot/waypoints.qh" #include "weapons/throwing.qh" +#include "command/common.qh" +#include "cheats.qh" +#include "bot/navigation.qh" +#include "weapons/selection.qh" +#include "weapons/tracing.qh" +#include "weapons/weaponsystem.qh" +#include "vehicles/vehicles_def.qh" +#include "waypointsprites.qh" #include "../common/weapons/weapons.qh" diff --git a/qcsrc/server/cl_physics.qc b/qcsrc/server/cl_physics.qc index 337342333..40552899a 100644 --- a/qcsrc/server/cl_physics.qc +++ b/qcsrc/server/cl_physics.qc @@ -1,3 +1,7 @@ +#include "_.qh" +#include "bot/bot.qh" +#include "g_damage.qh" + #if defined(CSQC) #elif defined(MENUQC) #elif defined(SVQC) @@ -659,32 +663,6 @@ void SpecialCommand() #endif } -float speedaward_speed; -string speedaward_holder; -string speedaward_uid; -void race_send_speedaward(float msg) -{ - // send the best speed of the round - WriteByte(msg, SVC_TEMPENTITY); - WriteByte(msg, TE_CSQC_RACE); - WriteByte(msg, RACE_NET_SPEED_AWARD); - WriteInt24_t(msg, floor(speedaward_speed+0.5)); - WriteString(msg, speedaward_holder); -} - -float speedaward_alltimebest; -string speedaward_alltimebest_holder; -string speedaward_alltimebest_uid; -void race_send_speedaward_alltimebest(float msg) -{ - // send the best speed - WriteByte(msg, SVC_TEMPENTITY); - WriteByte(msg, TE_CSQC_RACE); - WriteByte(msg, RACE_NET_SPEED_AWARD_BEST); - WriteInt24_t(msg, floor(speedaward_alltimebest+0.5)); - WriteString(msg, speedaward_alltimebest_holder); -} - string GetMapname(void); float speedaward_lastupdate; float speedaward_lastsent; diff --git a/qcsrc/server/cl_player.qc b/qcsrc/server/cl_player.qc index 416fb1db7..ce03dfa98 100644 --- a/qcsrc/server/cl_player.qc +++ b/qcsrc/server/cl_player.qc @@ -1,7 +1,23 @@ #include "cl_player.qh" +#include "_.qh" + +#include "bot/bot.qh" +#include "cheats.qh" +#include "g_damage.qh" +#include "g_subs.qh" #include "g_triggers.qh" #include "g_violence.qh" #include "miscfunctions.qh" +#include "portals.qh" +#include "teamplay.qh" +#include "waypointsprites.qh" +#include "weapons/throwing.qh" +#include "command/common.qh" +#include "../common/animdecide.qh" +#include "../common/csqcmodel_settings.qh" +#include "../common/deathtypes.qh" +#include "../common/playerstats.qh" +#include "../csqcmodellib/sv_model.qh" #include "weapons/weaponstats.qh" diff --git a/qcsrc/server/command/banning.qc b/qcsrc/server/command/banning.qc index 9091ae0b7..b69665117 100644 --- a/qcsrc/server/command/banning.qc +++ b/qcsrc/server/command/banning.qc @@ -1,14 +1,14 @@ -#if defined(CSQC) -#elif defined(MENUQC) -#elif defined(SVQC) - #include "../../dpdefs/dpextensions.qh" - #include "../../common/util.qh" - #include "../../common/command/shared_defs.qh" - #include "../autocvars.qh" - #include "common.qh" - #include "banning.qh" - #include "../ipban.qh" -#endif +#include "../_.qh" +#include "../cl_player.qh" + +#include "banning.qh" +#include "common.qh" + +#include "../ipban.qh" + +#include "../../common/command/shared_defs.qh" + +#include "../../common/util.qh" // ===================================================== // Banning and kicking command code, written by Samual // Last updated: December 29th, 2011 diff --git a/qcsrc/server/command/banning.qh b/qcsrc/server/command/banning.qh index 70daacc87..17eca95c7 100644 --- a/qcsrc/server/command/banning.qh +++ b/qcsrc/server/command/banning.qh @@ -16,4 +16,8 @@ float Ban_Delete(float i); // used by common/command/generic.qc:GenericCommand_dumpcommands to list all commands into a .txt file void BanCommand_macro_write_aliases(float fh); + +void BanCommand_macro_help(); +float BanCommand_macro_usage(float argc); + #endif diff --git a/qcsrc/server/command/cmd.qc b/qcsrc/server/command/cmd.qc index 14e0f201c..d09130743 100644 --- a/qcsrc/server/command/cmd.qc +++ b/qcsrc/server/command/cmd.qc @@ -1,31 +1,41 @@ -#if defined(CSQC) -#elif defined(MENUQC) -#elif defined(SVQC) - #include "../../dpdefs/progsdefs.qh" - #include "../../dpdefs/dpextensions.qh" - #include "../../warpzonelib/common.qh" - #include "../../common/constants.qh" - #include "../../common/teams.qh" - #include "../../common/util.qh" - #include "../../common/command/shared_defs.qh" - #include "../../common/monsters/monsters.qh" - #include "../../common/monsters/sv_monsters.qh" - #include "../../common/monsters/spawn.qh" - #include "../autocvars.qh" - #include "../defs.qh" - #include "../../common/notifications.qh" - #include "../../common/deathtypes.qh" - #include "../mutators/mutators_include.qh" - #include "../vehicles/vehicles_def.qh" - #include "../campaign.qh" - #include "../../common/mapinfo.qh" - #include "common.qh" - #include "vote.qh" - #include "cmd.qh" - #include "../cheats.qh" - #include "../scores.qh" - #include "../ipban.qh" -#endif +#include "cmd.qh" +#include "../_.qh" + +#include "common.qh" +#include "vote.qh" + +#include "../campaign.qh" +#include "../cheats.qh" +#include "../cl_player.qh" +#include "../g_triggers.qh" +#include "../ipban.qh" +#include "../mapvoting.qh" +#include "../scores.qh" +#include "../teamplay.qh" + +#include "../mutators/mutators_include.qh" + +#include "../vehicles/vehicles_def.qh" + +#include "../../common/constants.qh" +#include "../../common/deathtypes.qh" +#include "../../common/mapinfo.qh" +#include "../../common/notifications.qh" +#include "../../common/teams.qh" +#include "../../common/util.qh" + +#include "../../common/monsters/monsters.qh" +#include "../../common/monsters/spawn.qh" +#include "../../common/monsters/sv_monsters.qh" + +#include "../../common/command/shared_defs.qh" + +#include "../../dpdefs/dpextensions.qh" +#include "../../dpdefs/progsdefs.qh" + +#include "../../warpzonelib/common.qh" + +void ClientKill_TeamChange (float targetteam); // 0 = don't change, -1 = auto, -2 = spec // ========================================================= // Server side networked commands code, reworked by Samual diff --git a/qcsrc/server/command/common.qc b/qcsrc/server/command/common.qc index 5b7e761b7..3fcb0a3f7 100644 --- a/qcsrc/server/command/common.qc +++ b/qcsrc/server/command/common.qc @@ -1,5 +1,9 @@ #include "common.qh" +#include "../_.qh" +#include "../scores.qh" + +#include "../../common/notifications.qh" #include "../../common/counting.qh" diff --git a/qcsrc/server/command/getreplies.qc b/qcsrc/server/command/getreplies.qc index aa8efd6d6..38c4bf16c 100644 --- a/qcsrc/server/command/getreplies.qc +++ b/qcsrc/server/command/getreplies.qc @@ -1,17 +1,14 @@ -#if defined(CSQC) -#elif defined(MENUQC) -#elif defined(SVQC) - #include "../../dpdefs/progsdefs.qh" - #include "../../dpdefs/dpextensions.qh" - #include "../../common/constants.qh" - #include "../../common/util.qh" - #include "../../common/counting.qh" - #include "../../common/monsters/monsters.qh" - #include "../defs.qh" - #include "../../common/mapinfo.qh" - #include "getreplies.qh" - #include "../race.qh" -#endif +#include "getreplies.qh" +#include "../_.qh" + +#include "../race.qh" + +#include "../../common/constants.qh" +#include "../../common/counting.qh" +#include "../../common/mapinfo.qh" +#include "../../common/util.qh" + +#include "../../common/monsters/monsters.qh" // ========================================================= // Reply messages for common commands, re-worked by Samual diff --git a/qcsrc/server/command/radarmap.qc b/qcsrc/server/command/radarmap.qc index befbd1a8c..792aba112 100644 --- a/qcsrc/server/command/radarmap.qc +++ b/qcsrc/server/command/radarmap.qc @@ -1,13 +1,12 @@ -#if defined(CSQC) -#elif defined(MENUQC) -#elif defined(SVQC) - #include "../../dpdefs/progsdefs.qh" - #include "../../dpdefs/dpextensions.qh" - #include "../../common/util.qh" - #include "../defs.qh" - #include "radarmap.qh" - #include "../../csqcmodellib/sv_model.qh" -#endif +#include "radarmap.qh" +#include "../_.qh" + +#include "../g_subs.qh" +#include "../g_world.qh" + +#include "../../common/util.qh" + +#include "../../csqcmodellib/sv_model.qh" // =============================================== // Generates radar map images for use in the HUD diff --git a/qcsrc/server/command/radarmap.qh b/qcsrc/server/command/radarmap.qh index c2b068c7d..fea60ba9e 100644 --- a/qcsrc/server/command/radarmap.qh +++ b/qcsrc/server/command/radarmap.qh @@ -14,4 +14,8 @@ float sharpen_buffer[RADAR_WIDTH_MAX * 3]; string doublehex = "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFFFF"; // FF is contained twice, to map 256 to FF too // removes the need to bound() + +float RadarMap_Make(float argc); + + #endif diff --git a/qcsrc/server/command/sv_cmd.qc b/qcsrc/server/command/sv_cmd.qc index d4489106d..910d3e68e 100644 --- a/qcsrc/server/command/sv_cmd.qc +++ b/qcsrc/server/command/sv_cmd.qc @@ -1,25 +1,40 @@ -#if defined(CSQC) -#elif defined(MENUQC) -#elif defined(SVQC) - #include "../../dpdefs/progsdefs.qh" - #include "../../dpdefs/dpextensions.qh" - #include "../../warpzonelib/mathlib.qh" - #include "../../common/constants.qh" - #include "../../common/teams.qh" - #include "../../common/util.qh" - #include "../../common/command/shared_defs.qh" - #include "../../common/monsters/sv_monsters.qh" - #include "../autocvars.qh" - #include "../defs.qh" - #include "../../common/notifications.qh" - #include "../mutators/mutators_include.qh" - #include "../../common/mapinfo.qh" - #include "common.qh" - #include "cmd.qh" - #include "sv_cmd.qh" - #include "../anticheat.qh" - #include "../playerdemo.qh" -#endif +#include "sv_cmd.qh" +#include "../_.qh" + +#include "banning.qh" +#include "cmd.qh" +#include "common.qh" +#include "getreplies.qh" +#include "radarmap.qh" + +#include "../anticheat.qh" +#include "../campaign.qh" +#include "../cl_client.qh" +#include "../cl_player.qh" +#include "../g_world.qh" +#include "../ipban.qh" +#include "../playerdemo.qh" +#include "../teamplay.qh" + +#include "../bot/bot.qh" +#include "../bot/navigation.qh" +#include "../bot/scripting.qh" + +#include "../mutators/mutators_include.qh" + +#include "../../common/constants.qh" +#include "../../common/mapinfo.qh" +#include "../../common/notifications.qh" +#include "../../common/teams.qh" +#include "../../common/util.qh" + +#include "../../common/command/shared_defs.qh" + +#include "../../common/monsters/sv_monsters.qh" + +#include "../../warpzonelib/mathlib.qh" + +void PutObserverInServer (void); // ===================================================== // Server side game commands code, reworked by Samual diff --git a/qcsrc/server/command/vote.qc b/qcsrc/server/command/vote.qc index 61fd2f3a2..4e2d4732d 100644 --- a/qcsrc/server/command/vote.qc +++ b/qcsrc/server/command/vote.qc @@ -1,24 +1,23 @@ -#if defined(CSQC) -#elif defined(MENUQC) -#elif defined(SVQC) - #include "../../dpdefs/progsdefs.qh" - #include "../../dpdefs/dpextensions.qh" - #include "../../common/constants.qh" - #include "../../common/util.qh" - #include "../../common/command/shared_defs.qh" - #include "../autocvars.qh" - #include "../constants.qh" - #include "../defs.qh" - #include "../../common/notifications.qh" - #include "../mutators/mutators_include.qh" - #include "../../common/mapinfo.qh" - #include "common.qh" - #include "vote.qh" - #include "../../common/playerstats.qh" - #include "../scores.qh" - #include "../race.qh" - #include "../round_handler.qh" -#endif +#include "vote.qh" +#include "../_.qh" + +#include "common.qh" + +#include "../g_damage.qh" +#include "../g_world.qh" +#include "../race.qh" +#include "../round_handler.qh" +#include "../scores.qh" + +#include "../mutators/mutators_include.qh" + +#include "../../common/constants.qh" +#include "../../common/mapinfo.qh" +#include "../../common/notifications.qh" +#include "../../common/playerstats.qh" +#include "../../common/util.qh" + +#include "../../common/command/shared_defs.qh" // ============================================= // Server side voting code, reworked by Samual diff --git a/qcsrc/server/command/vote.qh b/qcsrc/server/command/vote.qh index ff33f5668..3c2845451 100644 --- a/qcsrc/server/command/vote.qh +++ b/qcsrc/server/command/vote.qh @@ -52,4 +52,5 @@ float restart_mapalreadyrestarted; // bool, indicates whether reset_map() was al .float ready; // flag for if a player is ready void reset_map(float dorespawn); void ReadyCount(); +void ReadyRestart_force(); #endif diff --git a/qcsrc/server/csqceffects.qh b/qcsrc/server/csqceffects.qh new file mode 100644 index 000000000..9fd0c386e --- /dev/null +++ b/qcsrc/server/csqceffects.qh @@ -0,0 +1,4 @@ +#ifndef CSQCEFFECTS_H +#define CSQCEFFECTS_H +void te_csqc_lightningarc(vector from,vector to); +#endif diff --git a/qcsrc/server/ent_cs.qc b/qcsrc/server/ent_cs.qc index 98ec27768..f65e58371 100644 --- a/qcsrc/server/ent_cs.qc +++ b/qcsrc/server/ent_cs.qc @@ -1,13 +1,7 @@ -#if defined(CSQC) -#elif defined(MENUQC) -#elif defined(SVQC) - #include "../dpdefs/progsdefs.qh" - #include "../dpdefs/dpextensions.qh" - #include "../common/constants.qh" - #include "constants.qh" - #include "defs.qh" - #include "mutators/mutators_include.qh" -#endif +#include "_.qh" + +#include "defs.qh" +#include "mutators/mutators_include.qh" /** * The point of these entities is to avoid the problems diff --git a/qcsrc/server/func_breakable.qc b/qcsrc/server/func_breakable.qc index be6104f1f..763975c10 100644 --- a/qcsrc/server/func_breakable.qc +++ b/qcsrc/server/func_breakable.qc @@ -1,3 +1,11 @@ +#include "_.qh" + +#include "g_subs.qh" +#include "waypointsprites.qh" +#include "g_damage.qh" +#include "bot/bot.qh" +#include "../common/csqcmodel_settings.qh" +#include "../csqcmodellib/sv_model.qh" #include "weapons/common.qh" .entity sprite; diff --git a/qcsrc/server/g_casings.qc b/qcsrc/server/g_casings.qc index 82374c41b..62649079f 100644 --- a/qcsrc/server/g_casings.qc +++ b/qcsrc/server/g_casings.qc @@ -1,12 +1,6 @@ -#if defined(CSQC) -#elif defined(MENUQC) -#elif defined(SVQC) - #include "../dpdefs/progsdefs.qh" - #include "../common/constants.qh" - #include "../common/util.qh" - #include "constants.qh" - #include "defs.qh" -#endif +#include "_.qh" + +#include "../common/util.qh" float Casing_SendEntity(entity to, int sf) { diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index 0adae54b2..beed2e1b3 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -1,31 +1,26 @@ #include "g_damage.qh" - -#if defined(CSQC) -#elif defined(MENUQC) -#elif defined(SVQC) - #include "../warpzonelib/common.qh" - #include "../common/constants.qh" - #include "../common/teams.qh" - #include "../common/util.qh" - #include "../common/weapons/weapons.qh" - #include "weapons/accuracy.qh" - #include "weapons/csqcprojectile.qh" - #include "weapons/selection.qh" - #include "t_items.qh" - #include "autocvars.qh" - #include "constants.qh" - #include "defs.qh" - #include "../common/notifications.qh" - #include "../common/deathtypes.qh" - #include "mutators/mutators_include.qh" - #include "tturrets/include/turrets_early.qh" - #include "vehicles/vehicles_def.qh" - #include "../csqcmodellib/sv_model.qh" - #include "../common/playerstats.qh" - #include "g_hook.qh" - #include "scores.qh" - #include "spawnpoints.qh" -#endif +#include "_.qh" + +#include "g_hook.qh" +#include "mutators/mutators_include.qh" +#include "scores.qh" +#include "waypointsprites.qh" +#include "spawnpoints.qh" +#include "tturrets/include/turrets_early.qh" +#include "t_items.qh" +#include "vehicles/vehicles_def.qh" +#include "weapons/accuracy.qh" +#include "weapons/csqcprojectile.qh" +#include "weapons/selection.qh" +#include "../common/constants.qh" +#include "../common/deathtypes.qh" +#include "../common/notifications.qh" +#include "../common/playerstats.qh" +#include "../common/teams.qh" +#include "../common/util.qh" +#include "../common/weapons/weapons.qh" +#include "../csqcmodellib/sv_model.qh" +#include "../warpzonelib/common.qh" float Damage_DamageInfo_SendEntity(entity to, int sf) { diff --git a/qcsrc/server/g_hook.qc b/qcsrc/server/g_hook.qc index 6a6c89b76..1c6c3a7d8 100644 --- a/qcsrc/server/g_hook.qc +++ b/qcsrc/server/g_hook.qc @@ -1,21 +1,20 @@ -#if defined(CSQC) -#elif defined(MENUQC) -#elif defined(SVQC) - #include "../dpdefs/progsdefs.qh" - #include "../dpdefs/dpextensions.qh" - #include "../warpzonelib/common.qh" - #include "../warpzonelib/server.qh" - #include "../common/constants.qh" - #include "../common/util.qh" - #include "../common/weapons/weapons.qh" - #include "autocvars.qh" - #include "constants.qh" - #include "defs.qh" - #include "vehicles/vehicles_def.qh" - #include "command/common.qh" - #include "g_hook.qh" - #include "round_handler.qh" -#endif +#include "g_hook.qh" +#include "_.qh" + +#include "weapons/common.qh" +#include "weapons/weaponsystem.qh" +#include "weapons/selection.qh" +#include "weapons/tracing.qh" +#include "cl_player.qh" +#include "t_teleporters.qh" +#include "command/common.qh" +#include "round_handler.qh" +#include "vehicles/vehicles_def.qh" +#include "../common/constants.qh" +#include "../common/util.qh" +#include "../common/weapons/weapons.qh" +#include "../warpzonelib/common.qh" +#include "../warpzonelib/server.qh" /*============================================ diff --git a/qcsrc/server/g_lights.qc b/qcsrc/server/g_lights.qc index da53fbe64..bdcef35e7 100644 --- a/qcsrc/server/g_lights.qc +++ b/qcsrc/server/g_lights.qc @@ -1,3 +1,7 @@ +#include "_.qh" + +void train_next(); + const float LOOP = 1; const float DNOSHADOW = 2; diff --git a/qcsrc/server/g_models.qc b/qcsrc/server/g_models.qc index 0214b9ed3..afc32926b 100644 --- a/qcsrc/server/g_models.qc +++ b/qcsrc/server/g_models.qc @@ -1,14 +1,10 @@ -#if defined(CSQC) -#elif defined(MENUQC) -#elif defined(SVQC) - #include "../dpdefs/progsdefs.qh" - #include "../dpdefs/dpextensions.qh" - #include "../common/constants.qh" - #include "autocvars.qh" - #include "constants.qh" - #include "defs.qh" - #include "../csqcmodellib/sv_model.qh" -#endif +#include "_.qh" + +#include "g_subs.qh" +#include "g_triggers.qh" + +#include "../common/constants.qh" +#include "../csqcmodellib/sv_model.qh" .float modelscale; diff --git a/qcsrc/server/g_subs.qc b/qcsrc/server/g_subs.qc index 74a8cf7f9..bcb3d61d2 100644 --- a/qcsrc/server/g_subs.qc +++ b/qcsrc/server/g_subs.qc @@ -1,4 +1,9 @@ #include "g_subs.qh" +#include "_.qh" + +#include "antilag.qh" +#include "command/common.qh" +#include "../warpzonelib/common.qh" void SUB_NullThink(void) { } diff --git a/qcsrc/server/g_triggers.qc b/qcsrc/server/g_triggers.qc index 408eaf2e7..51ee3451e 100644 --- a/qcsrc/server/g_triggers.qc +++ b/qcsrc/server/g_triggers.qc @@ -1,4 +1,10 @@ #include "g_triggers.qh" +#include "_.qh" + +#include "weapons/csqcprojectile.qh" +#include "../common/deathtypes.qh" +#include "../warpzonelib/util_server.qh" +#include "g_subs.qh" #include "t_jumppads.qh" void SUB_DontUseTargets() diff --git a/qcsrc/server/g_violence.qc b/qcsrc/server/g_violence.qc index 4ef4f45ff..b103933ca 100644 --- a/qcsrc/server/g_violence.qc +++ b/qcsrc/server/g_violence.qc @@ -1,4 +1,5 @@ #include "g_violence.qh" +#include "_.qh" float Violence_GibSplash_SendEntity(entity to, int sf) { diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index a79f3fa91..25f86a63d 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -1,39 +1,38 @@ #include "g_world.qh" - +#include "_.qh" + +#include "anticheat.qh" +#include "antilag.qh" +#include "bot/bot.qh" +#include "campaign.qh" +#include "cheats.qh" +#include "cl_client.qh" +#include "command/common.qh" +#include "command/getreplies.qh" +#include "command/sv_cmd.qh" +#include "command/vote.qh" +#include "g_hook.qh" +#include "ipban.qh" +#include "mapvoting.qh" +#include "mutators/mutators_include.qh" +#include "race.qh" +#include "scores.qh" +#include "secret.qh" +#include "teamplay.qh" +#include "waypointsprites.qh" +#include "weapons/weaponstats.qh" #include "../common/buffs.qh" - -#if defined(CSQC) -#elif defined(MENUQC) -#elif defined(SVQC) - #include "../common/constants.qh" - #include "../common/stats.qh" - #include "../common/teams.qh" - #include "../common/util.qh" - #include "../common/monsters/sv_monsters.qh" - #include "../common/weapons/weapons.qh" - #include "weapons/weaponstats.qh" - #include "autocvars.qh" - #include "constants.qh" - #include "defs.qh" - #include "../common/notifications.qh" - #include "mutators/mutators_include.qh" - #include "campaign.qh" - #include "../common/mapinfo.qh" - #include "command/common.qh" - #include "command/vote.qh" - #include "command/getreplies.qh" - #include "command/sv_cmd.qh" - #include "anticheat.qh" - #include "cheats.qh" - #include "../common/playerstats.qh" - #include "g_hook.qh" - #include "scores.qh" - #include "mapvoting.qh" - #include "ipban.qh" - #include "race.qh" - #include "antilag.qh" - #include "secret.qh" -#endif +#include "../common/constants.qh" +#include "../common/deathtypes.qh" +#include "../common/mapinfo.qh" +#include "../common/monsters/monsters.qh" +#include "../common/monsters/sv_monsters.qh" +#include "../common/notifications.qh" +#include "../common/playerstats.qh" +#include "../common/stats.qh" +#include "../common/teams.qh" +#include "../common/util.qh" +#include "../common/weapons/weapons.qh" const float LATENCY_THINKRATE = 10; .float latency_sum; @@ -93,9 +92,7 @@ string redirection_target; float world_initialized; string GetGametype(); -void GotoNextMap(float reinit); void ShuffleMaplist(); -float(float reinit) DoNextMapOverride; void SetDefaultAlpha() { @@ -2036,7 +2033,6 @@ CheckRules_World Exit deathmatch games upon conditions ============ */ -void ReadyRestart(); void CheckRules_World() { float timelimit; diff --git a/qcsrc/server/g_world.qh b/qcsrc/server/g_world.qh index 3a5e5d5ac..920ef71e1 100644 --- a/qcsrc/server/g_world.qh +++ b/qcsrc/server/g_world.qh @@ -13,5 +13,16 @@ const float WINNING_STARTSUDDENDEATHOVERTIME = 3; // no winner, enter suddendeat void CheckRules_Player(); void IntermissionThink(); +void GotoNextMap(float reinit); +void ReadyRestart(); + +void DumpStats(float final); +float Map_IsRecent(string m); +string GetNextMap(); +void ShuffleMaplist(); +void Map_Goto_SetStr(string nextmapname); +void Map_Goto(float reinit); +float DoNextMapOverride(float reinit); +void CheckRules_World(); #endif diff --git a/qcsrc/server/ipban.qc b/qcsrc/server/ipban.qc index 9591ee8ba..4499e0410 100644 --- a/qcsrc/server/ipban.qc +++ b/qcsrc/server/ipban.qc @@ -1,15 +1,13 @@ -#if defined(CSQC) -#elif defined(MENUQC) -#elif defined(SVQC) - #include "../dpdefs/progsdefs.qh" - #include "../dpdefs/dpextensions.qh" - #include "../common/constants.qh" - #include "../common/util.qh" - #include "autocvars.qh" - #include "defs.qh" - #include "command/banning.qh" - #include "ipban.qh" -#endif +#include "ipban.qh" +#include "_.qh" + +#include "autocvars.qh" +#include "command/banning.qh" +#include "defs.qh" +#include "../common/constants.qh" +#include "../common/util.qh" +#include "../dpdefs/dpextensions.qh" +#include "../dpdefs/progsdefs.qh" /* * Protocol of online ban list: diff --git a/qcsrc/server/item_key.qc b/qcsrc/server/item_key.qc index b2bbd86cc..5fa7834d1 100644 --- a/qcsrc/server/item_key.qc +++ b/qcsrc/server/item_key.qc @@ -1,15 +1,10 @@ -#if defined(CSQC) -#elif defined(MENUQC) -#elif defined(SVQC) - #include "../dpdefs/progsdefs.qh" - #include "../dpdefs/dpextensions.qh" - #include "../warpzonelib/util_server.qh" - #include "../common/util.qh" - #include "../common/monsters/monsters.qh" - #include "defs.qh" - #include "../common/notifications.qh" - #include "item_key.qh" -#endif +#include "item_key.qh" +#include "_.qh" + +#include "../common/monsters/monsters.qh" +#include "../common/notifications.qh" +#include "../common/util.qh" +#include "../warpzonelib/util_server.qh" /* TODO: diff --git a/qcsrc/server/mapvoting.qc b/qcsrc/server/mapvoting.qc index 178dfe7ba..334571f08 100644 --- a/qcsrc/server/mapvoting.qc +++ b/qcsrc/server/mapvoting.qc @@ -1,19 +1,13 @@ -#if defined(CSQC) -#elif defined(MENUQC) -#elif defined(SVQC) - #include "../dpdefs/progsdefs.qh" - #include "../dpdefs/dpextensions.qh" - #include "../common/constants.qh" - #include "../common/util.qh" - #include "autocvars.qh" - #include "constants.qh" - #include "defs.qh" - #include "../common/mapinfo.qh" - #include "command/getreplies.qh" - #include "command/cmd.qh" - #include "../common/playerstats.qh" - #include "mapvoting.qh" -#endif +#include "mapvoting.qh" +#include "_.qh" + +#include "g_world.qh" +#include "command/cmd.qh" +#include "command/getreplies.qh" +#include "../common/constants.qh" +#include "../common/mapinfo.qh" +#include "../common/playerstats.qh" +#include "../common/util.qh" float GameTypeVote_AvailabilityStatus(string gtname) { diff --git a/qcsrc/server/mapvoting.qh b/qcsrc/server/mapvoting.qh index d2eff1cf0..18194b7b6 100644 --- a/qcsrc/server/mapvoting.qh +++ b/qcsrc/server/mapvoting.qh @@ -1,10 +1,13 @@ #ifndef MAPVOTING_H #define MAPVOTING_H +#include "../common/constants.qh" + // definitions for functions used outside mapvoting.qc void MapVote_Start(); void MapVote_Spawn(); void MapVote_Think(); +void MapVote_SendPicture(float id); float GameTypeVote_Start(); float GameTypeVote_Finished(float pos); string GameTypeVote_MapInfo_FixName(string m); diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index 3d353c75c..4a0139080 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -1,34 +1,29 @@ -#if defined(CSQC) -#elif defined(MENUQC) -#elif defined(SVQC) - #include "miscfunctions.qh" - #include "../dpdefs/progsdefs.qh" - #include "../dpdefs/dpextensions.qh" - #include "../common/playerstats.qh" - #include "../warpzonelib/anglestransform.qh" - #include "../warpzonelib/server.qh" - #include "../common/constants.qh" - #include "../common/teams.qh" - #include "../common/util.qh" - #include "../common/urllib.qh" - #include "../common/command/generic.qh" - #include "../common/weapons/weapons.qh" - #include "weapons/accuracy.qh" - #include "weapons/csqcprojectile.qh" - #include "weapons/selection.qh" - #include "t_items.qh" - #include "autocvars.qh" - #include "constants.qh" - #include "defs.qh" - #include "../common/notifications.qh" - #include "../common/deathtypes.qh" - #include "mutators/mutators_include.qh" - #include "tturrets/include/turrets_early.qh" - #include "../common/mapinfo.qh" - #include "command/common.qh" - #include "../csqcmodellib/sv_model.qh" - #include "ipban.qh" -#endif +#include "miscfunctions.qh" +#include "_.qh" + +#include "antilag.qh" +#include "command/common.qh" +#include "constants.qh" +#include "ipban.qh" +#include "mutators/mutators_include.qh" +#include "tturrets/include/turrets_early.qh" +#include "t_items.qh" +#include "weapons/accuracy.qh" +#include "weapons/csqcprojectile.qh" +#include "weapons/selection.qh" +#include "../common/command/generic.qh" +#include "../common/constants.qh" +#include "../common/deathtypes.qh" +#include "../common/mapinfo.qh" +#include "../common/notifications.qh" +#include "../common/playerstats.qh" +#include "../common/teams.qh" +#include "../common/urllib.qh" +#include "../common/util.qh" +#include "../common/weapons/weapons.qh" +#include "../csqcmodellib/sv_model.qh" +#include "../warpzonelib/anglestransform.qh" +#include "../warpzonelib/server.qh" void crosshair_trace(entity pl) { @@ -1303,7 +1298,6 @@ void Net_LinkEntity(entity e, float docull, float dt, bool(entity, int) sendfunc } -entity eliminatedPlayers; .float(entity) isEliminated; float EliminatedPlayers_SendEntity(entity to, float sendflags) { diff --git a/qcsrc/server/miscfunctions.qh b/qcsrc/server/miscfunctions.qh index f19f53fd0..b8d1fc533 100644 --- a/qcsrc/server/miscfunctions.qh +++ b/qcsrc/server/miscfunctions.qh @@ -32,6 +32,42 @@ float cvar_normal(string n) .float uncustomizeentityforclient_set; .float nottargeted; +entity eliminatedPlayers; +void EliminatedPlayers_Init(float(entity) isEliminated_func); + +string admin_name(void); + +void write_recordmarker(entity pl, float tstart, float dt); + +void play2all(string samp); + +void DistributeEvenly_Init(float amount, float totalweight); +float DistributeEvenly_Get(float weight); + +void modeleffect_spawn(string m, float s, float f, vector o, vector v, vector ang, vector angv, float s0, float s2, float a, float t1, float t2); + +void shockwave_spawn(string m, vector org, float sz, float t1, float t2); + +vector randompos(vector m1, vector m2); + +void play2team(float t, string filename); + +void GetCvars_handleFloat(string thisname, float f, .float field, string name); + +float spamsound(entity e, float chan, string samp, float vol, float _atten); + +void GetCvars_handleString(string thisname, float f, .string field, string name); + +void precache_all_playermodels(string pattern); + +void soundat(entity e, vector o, float chan, string samp, float vol, float _atten); + +void defer(float fdelay, void() func); + +void UncustomizeEntitiesRun(); +void InitializeEntitiesRun(); + +void stopsoundto(float _dest, entity e, float chan); float DistributeEvenly_amount; float DistributeEvenly_totalweight; @@ -68,6 +104,8 @@ float isPushable(entity e); float LostMovetypeFollow(entity ent); +string uid2name(string myuid); + float MoveToRandomMapLocation(entity e, float goodcontents, float badcontents, float badsurfaceflags, float attempts, float maxaboveground, float minviewdistance); string NearestLocation(vector p); diff --git a/qcsrc/server/mutators/base.qc b/qcsrc/server/mutators/base.qc index 71bcd9e58..81f759c8b 100644 --- a/qcsrc/server/mutators/base.qc +++ b/qcsrc/server/mutators/base.qc @@ -1,3 +1,6 @@ +#include "base.qh" +#include "../_.qh" + .float() cbc_func; .entity cbc_next; .float cbc_order; diff --git a/qcsrc/server/mutators/gamemode.qh b/qcsrc/server/mutators/gamemode.qh new file mode 100644 index 000000000..38e9ad8a3 --- /dev/null +++ b/qcsrc/server/mutators/gamemode.qh @@ -0,0 +1,49 @@ +#ifndef GAMEMODE_H +#define GAMEMODE_H + +#include "mutator_nades.qh" + +#include "../cl_client.qh" +#include "../cl_player.qh" +#include "../cl_impulse.qh" +#include "../cheats.qh" +#include "../g_damage.qh" +#include "../g_subs.qh" +#include "../t_teleporters.qh" +#include "../round_handler.qh" +#include "../scores.qh" +#include "../scores_rules.qh" +#include "../waypointsprites.qh" + +#include "../bot/bot.qh" +#include "../bot/navigation.qh" +#include "../bot/waypoints.qh" +#include "../bot/havocbot/roles.qh" +#include "../bot/havocbot/role_keyhunt.qh" + +#include "../bot/havocbot/havocbot.qh" + +#include "../command/vote.qh" + +#include "../../common/monsters/monsters.qh" + +#include "../command/common.qh" + +#include "../weapons/tracing.qh" +#include "../weapons/weaponsystem.qh" + +#include "../../common/deathtypes.qh" +#include "../../common/notifications.qh" +#include "../../common/stats.qh" +#include "../../common/teams.qh" + +#include "../../warpzonelib/mathlib.qh" +#include "../../warpzonelib/server.qh" +#include "../../warpzonelib/util_server.qh" + +.float lastground; +float total_players; +float redalive, bluealive, yellowalive, pinkalive; +.float redalive_stat, bluealive_stat, yellowalive_stat, pinkalive_stat; + +#endif diff --git a/qcsrc/server/mutators/gamemode_assault.qc b/qcsrc/server/mutators/gamemode_assault.qc index 49deac0e8..d14d9da8c 100644 --- a/qcsrc/server/mutators/gamemode_assault.qc +++ b/qcsrc/server/mutators/gamemode_assault.qc @@ -1,3 +1,10 @@ +#include "gamemode_assault.qh" +#include "../_.qh" + +#include "gamemode.qh" + +.entity sprite; + // random functions void assault_objective_use() { diff --git a/qcsrc/server/mutators/gamemode_ca.qc b/qcsrc/server/mutators/gamemode_ca.qc index a0f238358..ab198e30e 100644 --- a/qcsrc/server/mutators/gamemode_ca.qc +++ b/qcsrc/server/mutators/gamemode_ca.qc @@ -1,6 +1,8 @@ -float total_players; -float redalive, bluealive, yellowalive, pinkalive; -.float redalive_stat, bluealive_stat, yellowalive_stat, pinkalive_stat; +#include "gamemode_ca.qh" +#include "../_.qh" + +#include "gamemode.qh" + float ca_teams; float allowed_to_spawn; diff --git a/qcsrc/server/mutators/gamemode_ctf.qc b/qcsrc/server/mutators/gamemode_ctf.qc index 0cbcf714c..d40263fb7 100644 --- a/qcsrc/server/mutators/gamemode_ctf.qc +++ b/qcsrc/server/mutators/gamemode_ctf.qc @@ -1,3 +1,13 @@ +#include "gamemode_ctf.qh" +#include "../_.qh" + +#include "gamemode.qh" + +#include "../vehicles/vehicles_def.qh" + +#include "../../warpzonelib/common.qh" +#include "../../warpzonelib/mathlib.qh" + // ================================================================ // Official capture the flag game mode coding, reworked by Samual // Last updated: September, 2012 diff --git a/qcsrc/server/mutators/gamemode_ctf.qh b/qcsrc/server/mutators/gamemode_ctf.qh index 0e5930db2..302f6ce10 100644 --- a/qcsrc/server/mutators/gamemode_ctf.qh +++ b/qcsrc/server/mutators/gamemode_ctf.qh @@ -93,6 +93,8 @@ const float RETURN_DAMAGE = 3; const float RETURN_SPEEDRUN = 4; const float RETURN_NEEDKILL = 5; +void ctf_Handle_Throw(entity player, entity receiver, float droptype); + // flag properties #define ctf_spawnorigin dropped_origin float ctf_stalemate; // indicates that a stalemate is active diff --git a/qcsrc/server/mutators/gamemode_cts.qc b/qcsrc/server/mutators/gamemode_cts.qc index 0886a9ce5..aa5a936e7 100644 --- a/qcsrc/server/mutators/gamemode_cts.qc +++ b/qcsrc/server/mutators/gamemode_cts.qc @@ -1,3 +1,10 @@ +#include "gamemode_cts.qh" +#include "../_.qh" + +#include "gamemode.qh" + +#include "../race.qh" + // legacy bot roles .float race_checkpoint; void havocbot_role_cts() diff --git a/qcsrc/server/mutators/gamemode_domination.qc b/qcsrc/server/mutators/gamemode_domination.qc index dd6e8b210..d2df87cb8 100644 --- a/qcsrc/server/mutators/gamemode_domination.qc +++ b/qcsrc/server/mutators/gamemode_domination.qc @@ -1,3 +1,8 @@ +#include "gamemode_domination.qh" +#include "../_.qh" + +#include "gamemode.qh" + void dom_EventLog(string mode, float team_before, entity actor) // use an alias for easy changing and quick editing later { if(autocvar_sv_eventlog) diff --git a/qcsrc/server/mutators/gamemode_freezetag.qc b/qcsrc/server/mutators/gamemode_freezetag.qc index d6285cdaf..779e15d57 100644 --- a/qcsrc/server/mutators/gamemode_freezetag.qc +++ b/qcsrc/server/mutators/gamemode_freezetag.qc @@ -1,8 +1,7 @@ -.float freezetag_frozen_time; -.float freezetag_frozen_timeout; -const float ICE_MAX_ALPHA = 1; -const float ICE_MIN_ALPHA = 0.1; -float freezetag_teams; +#include "gamemode_freezetag.qh" +#include "../_.qh" + +#include "gamemode.qh" const float SP_FREEZETAG_REVIVALS = 4; void freezetag_ScoreRules(float teams) @@ -425,7 +424,6 @@ MUTATOR_HOOKFUNCTION(freezetag_GiveFragsForKill) return 1; } -.float reviving; // temp var MUTATOR_HOOKFUNCTION(freezetag_PlayerPreThink) { float n; diff --git a/qcsrc/server/mutators/gamemode_freezetag.qh b/qcsrc/server/mutators/gamemode_freezetag.qh new file mode 100644 index 000000000..19489fcfb --- /dev/null +++ b/qcsrc/server/mutators/gamemode_freezetag.qh @@ -0,0 +1,11 @@ +#ifndef GAMEMODE_FREEZETAG_H +#define GAMEMODE_FREEZETAG_H +.float freezetag_frozen_time; +.float freezetag_frozen_timeout; +const float ICE_MAX_ALPHA = 1; +const float ICE_MIN_ALPHA = 0.1; +float freezetag_teams; + +.float reviving; // temp var + +#endif diff --git a/qcsrc/server/mutators/gamemode_invasion.qc b/qcsrc/server/mutators/gamemode_invasion.qc index fe0d0a7ec..5720e55d8 100644 --- a/qcsrc/server/mutators/gamemode_invasion.qc +++ b/qcsrc/server/mutators/gamemode_invasion.qc @@ -1,3 +1,11 @@ +#include "gamemode_invasion.qh" +#include "../_.qh" + +#include "gamemode.qh" + +#include "../../common/monsters/spawn.qh" +#include "../../common/monsters/sv_monsters.qh" + void spawnfunc_invasion_spawnpoint() { if(!g_invasion) { remove(self); return; } diff --git a/qcsrc/server/mutators/gamemode_keepaway.qc b/qcsrc/server/mutators/gamemode_keepaway.qc index 095857e14..687839c0e 100644 --- a/qcsrc/server/mutators/gamemode_keepaway.qc +++ b/qcsrc/server/mutators/gamemode_keepaway.qc @@ -1,3 +1,8 @@ +#include "gamemode_keepaway.qh" +#include "../_.qh" + +#include "gamemode.qh" + // =========================================================== // Keepaway game mode coding, written by Samual and Diabolik // Last updated: September, 2012 diff --git a/qcsrc/server/mutators/gamemode_keepaway.qh b/qcsrc/server/mutators/gamemode_keepaway.qh index fd9ed4f2f..250f2fbc9 100644 --- a/qcsrc/server/mutators/gamemode_keepaway.qh +++ b/qcsrc/server/mutators/gamemode_keepaway.qh @@ -11,4 +11,7 @@ const float SP_KEEPAWAY_BCTIME = 6; void() havocbot_role_ka_carrier; void() havocbot_role_ka_collector; + +void ka_DropEvent(entity plyr); + #endif diff --git a/qcsrc/server/mutators/gamemode_keyhunt.qc b/qcsrc/server/mutators/gamemode_keyhunt.qc index d0103d80e..780aba8d8 100644 --- a/qcsrc/server/mutators/gamemode_keyhunt.qc +++ b/qcsrc/server/mutators/gamemode_keyhunt.qc @@ -1,4 +1,8 @@ -#define FOR_EACH_KH_KEY(v) for(v = kh_worldkeylist; v; v = v.kh_worldkeynext ) +#include "gamemode_keyhunt.qh" +#include "../_.qh" + +#include "gamemode.qh" + // #define KH_PLAYER_USE_ATTACHMENT // #define KH_PLAYER_USE_CARRIEDMODEL diff --git a/qcsrc/server/mutators/gamemode_keyhunt.qh b/qcsrc/server/mutators/gamemode_keyhunt.qh index 6b27431c2..4d1645d02 100644 --- a/qcsrc/server/mutators/gamemode_keyhunt.qh +++ b/qcsrc/server/mutators/gamemode_keyhunt.qh @@ -1,6 +1,8 @@ #ifndef GAMEMODE_KEYHUNT_H #define GAMEMODE_KEYHUNT_H +#define FOR_EACH_KH_KEY(v) for(v = kh_worldkeylist; v; v = v.kh_worldkeynext ) + // ALL OF THESE should be removed in the future, as other code should not have to care // used by bots: @@ -11,4 +13,7 @@ float kh_Key_AllOwnedByWhichTeam(); typedef void(void) kh_Think_t; void kh_StartRound(); void kh_Controller_SetThink(float t, kh_Think_t func); + +void kh_Key_DropAll(entity player, float suicide); + #endif diff --git a/qcsrc/server/mutators/gamemode_lms.qc b/qcsrc/server/mutators/gamemode_lms.qc index 13b77305a..9f658df84 100644 --- a/qcsrc/server/mutators/gamemode_lms.qc +++ b/qcsrc/server/mutators/gamemode_lms.qc @@ -1,3 +1,11 @@ +#include "gamemode_lms.qh" +#include "../_.qh" + +#include "gamemode.qh" + +#include "../campaign.qh" +#include "../command/cmd.qh" + // main functions float LMS_NewPlayerLives() { diff --git a/qcsrc/server/mutators/gamemode_nexball.qc b/qcsrc/server/mutators/gamemode_nexball.qc index afdb769cf..3e5c19523 100644 --- a/qcsrc/server/mutators/gamemode_nexball.qc +++ b/qcsrc/server/mutators/gamemode_nexball.qc @@ -1,3 +1,10 @@ +#include "gamemode_nexball.qh" +#include "../_.qh" + +#include "gamemode.qh" + +#include "../t_jumppads.qh" + float autocvar_g_nexball_safepass_turnrate; float autocvar_g_nexball_safepass_maxdist; float autocvar_g_nexball_safepass_holdtime; diff --git a/qcsrc/server/mutators/gamemode_onslaught.qc b/qcsrc/server/mutators/gamemode_onslaught.qc index 7d02e6ff9..06aaeddd4 100644 --- a/qcsrc/server/mutators/gamemode_onslaught.qc +++ b/qcsrc/server/mutators/gamemode_onslaught.qc @@ -1,3 +1,7 @@ +#include "../_.qh" + +#include "gamemode.qh" + float autocvar_g_onslaught_spawn_at_controlpoints; float autocvar_g_onslaught_spawn_at_generator; float autocvar_g_onslaught_cp_proxydecap; diff --git a/qcsrc/server/mutators/gamemode_race.qc b/qcsrc/server/mutators/gamemode_race.qc index 7ba832846..26a06e3fc 100644 --- a/qcsrc/server/mutators/gamemode_race.qc +++ b/qcsrc/server/mutators/gamemode_race.qc @@ -1,3 +1,10 @@ +#include "gamemode_race.qh" +#include "../_.qh" + +#include "gamemode.qh" + +#include "../race.qh" + // legacy bot roles .float race_checkpoint; void havocbot_role_race() diff --git a/qcsrc/server/mutators/gamemode_tdm.qc b/qcsrc/server/mutators/gamemode_tdm.qc index de172873e..67cbeba68 100644 --- a/qcsrc/server/mutators/gamemode_tdm.qc +++ b/qcsrc/server/mutators/gamemode_tdm.qc @@ -1,3 +1,7 @@ +#include "../_.qh" + +#include "gamemode.qh" + /*QUAKED spawnfunc_tdm_team (0 .5 .8) (-16 -16 -24) (16 16 32) Team declaration for TDM gameplay, this allows you to decide what team names and control point models are used in your map. Note: If you use spawnfunc_tdm_team entities you must define at least 2! However, unlike domination, you don't need to make a blank one too. diff --git a/qcsrc/server/mutators/mutator.qh b/qcsrc/server/mutators/mutator.qh new file mode 100644 index 000000000..6cded5366 --- /dev/null +++ b/qcsrc/server/mutators/mutator.qh @@ -0,0 +1,47 @@ +#ifndef MUTATOR_H +#define MUTATOR_H + +#include "base.qh" +#include "mutator_nades.qh" + +#include "../cl_client.qh" +#include "../cl_player.qh" +#include "../cl_impulse.qh" +#include "../cheats.qh" +#include "../g_damage.qh" +#include "../g_subs.qh" +#include "../t_teleporters.qh" +#include "../round_handler.qh" +#include "../scores.qh" +#include "../scores_rules.qh" +#include "../waypointsprites.qh" + +#include "../bot/bot.qh" +#include "../bot/navigation.qh" +#include "../bot/waypoints.qh" + +#include "../bot/havocbot/havocbot.qh" +#include "../bot/havocbot/roles.qh" +#include "../bot/havocbot/role_keyhunt.qh" + +#include "../command/vote.qh" +#include "../command/common.qh" + +#include "../weapons/common.qh" +#include "../weapons/tracing.qh" +#include "../weapons/throwing.qh" +#include "../weapons/weaponsystem.qh" + +#include "../../common/deathtypes.qh" +#include "../../common/notifications.qh" +#include "../../common/stats.qh" +#include "../../common/teams.qh" + +#include "../../common/monsters/monsters.qh" + +#include "../../warpzonelib/anglestransform.qh" +#include "../../warpzonelib/mathlib.qh" +#include "../../warpzonelib/server.qh" +#include "../../warpzonelib/util_server.qh" + +#endif diff --git a/qcsrc/server/mutators/mutator_bloodloss.qc b/qcsrc/server/mutators/mutator_bloodloss.qc index 08e14199e..910c7143a 100644 --- a/qcsrc/server/mutators/mutator_bloodloss.qc +++ b/qcsrc/server/mutators/mutator_bloodloss.qc @@ -1,3 +1,7 @@ +#include "../_.qh" + +#include "mutator.qh" + .float bloodloss_timer; MUTATOR_HOOKFUNCTION(bloodloss_PlayerThink) diff --git a/qcsrc/server/mutators/mutator_buffs.qc b/qcsrc/server/mutators/mutator_buffs.qc index b2f800a27..fc7bd42c7 100644 --- a/qcsrc/server/mutators/mutator_buffs.qc +++ b/qcsrc/server/mutators/mutator_buffs.qc @@ -1,3 +1,12 @@ +#include "mutator_buffs.qh" +#include "../_.qh" + +#include "mutator.qh" + +#include "../../common/buffs.qh" + +.float lifetime; + float buffs_BuffModel_Customize() { entity player, myowner; diff --git a/qcsrc/server/mutators/mutator_campcheck.qc b/qcsrc/server/mutators/mutator_campcheck.qc index 21dd71f98..19936b359 100644 --- a/qcsrc/server/mutators/mutator_campcheck.qc +++ b/qcsrc/server/mutators/mutator_campcheck.qc @@ -1,3 +1,9 @@ +#include "../_.qh" + +#include "mutator.qh" + +#include "../campaign.qh" + .float campcheck_nextcheck; .float campcheck_traveled_distance; diff --git a/qcsrc/server/mutators/mutator_dodging.qc b/qcsrc/server/mutators/mutator_dodging.qc index 58d24a4d8..a293b9f96 100644 --- a/qcsrc/server/mutators/mutator_dodging.qc +++ b/qcsrc/server/mutators/mutator_dodging.qc @@ -1,3 +1,9 @@ +#include "mutator_dodging.qh" +#include "../_.qh" + +#include "mutator.qh" + +#include "../../common/animdecide.qh" .float cvar_cl_dodging_timeout; diff --git a/qcsrc/server/mutators/mutator_instagib.qc b/qcsrc/server/mutators/mutator_instagib.qc index b3502b0f7..a7564a0df 100644 --- a/qcsrc/server/mutators/mutator_instagib.qc +++ b/qcsrc/server/mutators/mutator_instagib.qc @@ -1,3 +1,10 @@ +#include "../_.qh" + +#include "mutator.qh" + +#include "../cl_client.qh" +#include "../../common/buffs.qh" + void spawnfunc_item_minst_cells (void) { if (!g_instagib) { remove(self); return; } diff --git a/qcsrc/server/mutators/mutator_invincibleproj.qc b/qcsrc/server/mutators/mutator_invincibleproj.qc index d1ab52000..7c20c1037 100644 --- a/qcsrc/server/mutators/mutator_invincibleproj.qc +++ b/qcsrc/server/mutators/mutator_invincibleproj.qc @@ -1,3 +1,7 @@ +#include "../_.qh" + +#include "mutator.qh" + MUTATOR_HOOKFUNCTION(invincibleprojectiles_EditProjectile) { if(other.health) diff --git a/qcsrc/server/mutators/mutator_melee_only.qc b/qcsrc/server/mutators/mutator_melee_only.qc index b4f9c3771..3ffc0ffdd 100644 --- a/qcsrc/server/mutators/mutator_melee_only.qc +++ b/qcsrc/server/mutators/mutator_melee_only.qc @@ -1,3 +1,7 @@ +#include "../_.qh" + +#include "mutator.qh" + MUTATOR_HOOKFUNCTION(melee_SetStartItems) { start_ammo_shells = warmup_start_ammo_shells = 0; diff --git a/qcsrc/server/mutators/mutator_midair.qc b/qcsrc/server/mutators/mutator_midair.qc index d582c05ce..fdffd6ed7 100644 --- a/qcsrc/server/mutators/mutator_midair.qc +++ b/qcsrc/server/mutators/mutator_midair.qc @@ -1,3 +1,7 @@ +#include "../_.qh" + +#include "mutator.qh" + .float midair_shieldtime; MUTATOR_HOOKFUNCTION(midair_PlayerDamage) diff --git a/qcsrc/server/mutators/mutator_multijump.qc b/qcsrc/server/mutators/mutator_multijump.qc index d36f3ecbe..584ece8f1 100644 --- a/qcsrc/server/mutators/mutator_multijump.qc +++ b/qcsrc/server/mutators/mutator_multijump.qc @@ -1,3 +1,9 @@ +#include "../_.qh" + +#include "mutator.qh" + +#include "../antilag.qh" + .float multijump_count; .float multijump_ready; diff --git a/qcsrc/server/mutators/mutator_nades.qc b/qcsrc/server/mutators/mutator_nades.qc index 8f7857b16..ddcd81915 100644 --- a/qcsrc/server/mutators/mutator_nades.qc +++ b/qcsrc/server/mutators/mutator_nades.qc @@ -1,3 +1,16 @@ +#include "mutator_nades.qh" +#include "../_.qh" + +#include "mutator.qh" + +#include "gamemode_keyhunt.qh" +#include "gamemode_freezetag.qh" +#include "../../common/nades.qh" +#include "../../common/monsters/spawn.qh" +#include "../../common/monsters/sv_monsters.qh" + +.float lifetime; + .entity nade_spawnloc; void nade_timer_think() diff --git a/qcsrc/server/mutators/mutator_new_toys.qc b/qcsrc/server/mutators/mutator_new_toys.qc index 5aa94b187..bca6595c1 100644 --- a/qcsrc/server/mutators/mutator_new_toys.qc +++ b/qcsrc/server/mutators/mutator_new_toys.qc @@ -1,3 +1,7 @@ +#include "../_.qh" + +#include "mutator.qh" + /* CORE laser vortex lg rl cry gl elec hagar fireb hook diff --git a/qcsrc/server/mutators/mutator_nix.qc b/qcsrc/server/mutators/mutator_nix.qc index ec5574527..eb7f8f75b 100644 --- a/qcsrc/server/mutators/mutator_nix.qc +++ b/qcsrc/server/mutators/mutator_nix.qc @@ -1,3 +1,7 @@ +#include "../_.qh" + +#include "mutator.qh" + float g_nix_with_blaster; // WEAPONTODO int nix_weapon; diff --git a/qcsrc/server/mutators/mutator_overkill.qc b/qcsrc/server/mutators/mutator_overkill.qc index b707fbee0..ccf499a34 100644 --- a/qcsrc/server/mutators/mutator_overkill.qc +++ b/qcsrc/server/mutators/mutator_overkill.qc @@ -1,3 +1,12 @@ +#include "mutator_overkill.qh" +#include "../_.qh" + +#include "mutator.qh" + +void W_Blaster_Attack(float, float, float, float, float, float, float, float, float, float); +void spawnfunc_weapon_hmg(); +void spawnfunc_weapon_rpc(); + void ok_DecreaseCharge(entity ent, int wep) { if(!ent.ok_use_ammocharge) return; diff --git a/qcsrc/server/mutators/mutator_physical_items.qc b/qcsrc/server/mutators/mutator_physical_items.qc index 4963b3c8f..1554ed7ba 100644 --- a/qcsrc/server/mutators/mutator_physical_items.qc +++ b/qcsrc/server/mutators/mutator_physical_items.qc @@ -1,3 +1,7 @@ +#include "../_.qh" + +#include "mutator.qh" + .vector spawn_origin, spawn_angles; void physical_item_think() diff --git a/qcsrc/server/mutators/mutator_pinata.qc b/qcsrc/server/mutators/mutator_pinata.qc index 7cf405ef7..235eee59c 100644 --- a/qcsrc/server/mutators/mutator_pinata.qc +++ b/qcsrc/server/mutators/mutator_pinata.qc @@ -1,3 +1,7 @@ +#include "../_.qh" + +#include "mutator.qh" + MUTATOR_HOOKFUNCTION(pinata_PlayerDies) { float j; diff --git a/qcsrc/server/mutators/mutator_random_gravity.qc b/qcsrc/server/mutators/mutator_random_gravity.qc index f70ee4ba3..27fcbf99e 100644 --- a/qcsrc/server/mutators/mutator_random_gravity.qc +++ b/qcsrc/server/mutators/mutator_random_gravity.qc @@ -1,3 +1,7 @@ +#include "../_.qh" + +#include "mutator.qh" + // Random Gravity // // Mutator by Mario diff --git a/qcsrc/server/mutators/mutator_rocketflying.qc b/qcsrc/server/mutators/mutator_rocketflying.qc index 03a5bde61..db1bb78e3 100644 --- a/qcsrc/server/mutators/mutator_rocketflying.qc +++ b/qcsrc/server/mutators/mutator_rocketflying.qc @@ -1,3 +1,7 @@ +#include "../_.qh" + +#include "mutator.qh" + MUTATOR_HOOKFUNCTION(rocketflying_EditProjectile) { if(other.classname == "rocket" || other.classname == "mine") diff --git a/qcsrc/server/mutators/mutator_spawn_near_teammate.qc b/qcsrc/server/mutators/mutator_spawn_near_teammate.qc index 8dc3bbc6c..82c5a0e51 100644 --- a/qcsrc/server/mutators/mutator_spawn_near_teammate.qc +++ b/qcsrc/server/mutators/mutator_spawn_near_teammate.qc @@ -1,3 +1,7 @@ +#include "../_.qh" + +#include "mutator.qh" + .entity msnt_lookat; .float msnt_timer; diff --git a/qcsrc/server/mutators/mutator_superspec.qc b/qcsrc/server/mutators/mutator_superspec.qc index 1fd1022e7..8c065af51 100644 --- a/qcsrc/server/mutators/mutator_superspec.qc +++ b/qcsrc/server/mutators/mutator_superspec.qc @@ -1,3 +1,7 @@ +#include "../_.qh" + +#include "mutator.qh" + #define _SSMAGIX "SUPERSPEC_OPTIONSFILE_V1" #define _ISLOCAL ((edict_num(1) == self) ? true : false) diff --git a/qcsrc/server/mutators/mutator_touchexplode.qc b/qcsrc/server/mutators/mutator_touchexplode.qc index fb58b3955..e3507c678 100644 --- a/qcsrc/server/mutators/mutator_touchexplode.qc +++ b/qcsrc/server/mutators/mutator_touchexplode.qc @@ -1,3 +1,7 @@ +#include "../_.qh" + +#include "mutator.qh" + .float touchexplode_time; void PlayerTouchExplode(entity p1, entity p2) diff --git a/qcsrc/server/mutators/mutator_vampire.qc b/qcsrc/server/mutators/mutator_vampire.qc index aa45fc1ac..2b12f7a8b 100644 --- a/qcsrc/server/mutators/mutator_vampire.qc +++ b/qcsrc/server/mutators/mutator_vampire.qc @@ -1,3 +1,7 @@ +#include "../_.qh" + +#include "mutator.qh" + MUTATOR_HOOKFUNCTION(vampire_PlayerDamage) { if(time >= frag_target.spawnshieldtime) diff --git a/qcsrc/server/mutators/sandbox.qc b/qcsrc/server/mutators/sandbox.qc index f66b5019a..8807f25d9 100644 --- a/qcsrc/server/mutators/sandbox.qc +++ b/qcsrc/server/mutators/sandbox.qc @@ -1,3 +1,7 @@ +#include "../_.qh" + +#include "mutator.qh" + const float MAX_STORAGE_ATTACHMENTS = 16; float object_count; .float object_flood; diff --git a/qcsrc/server/pathlib.qc b/qcsrc/server/pathlib.qc index 2f66441f7..a24b431f9 100644 --- a/qcsrc/server/pathlib.qc +++ b/qcsrc/server/pathlib.qc @@ -1,54 +1,11 @@ -//#define PATHLIB_RDFIELDS -#ifdef PATHLIB_RDFIELDS - #define path_next swampslug - #define path_prev lasertarget -#else - .entity path_next; - .entity path_prev; -#endif +#include "pathlib.qh" +#include "_.qh" + +#include "g_subs.qh" #define medium spawnshieldtime //#define DEBUGPATHING - -entity openlist; -entity closedlist; -entity scraplist; - -.float pathlib_node_g; -.float pathlib_node_h; -.float pathlib_node_f; - -float pathlib_open_cnt; -float pathlib_closed_cnt; -float pathlib_made_cnt; -float pathlib_merge_cnt; -float pathlib_recycle_cnt; -float pathlib_searched_cnt; - -#ifdef DEBUGPATHING - -#endif - -float pathlib_bestopen_seached; -float pathlib_bestcash_hits; -float pathlib_bestcash_saved; - -float pathlib_gridsize; - -float pathlib_movecost; -float pathlib_movecost_diag; -float pathlib_movecost_waterfactor; - -float pathlib_edge_check_size; - -float pathlib_foundgoal; -entity goal_node; - -entity best_open_node; -.float is_path_node; - - #ifdef DEBUGPATHING float edge_show(vector point,float fsize); void mark_error(vector where,float lifetime); @@ -161,16 +118,6 @@ float floor_ok(vector point) return 0; } -#define inwater(point) (pointcontents(point) == CONTENT_WATER) -/* -float inwater(vector point) -{ - if(pointcontents(point) == CONTENT_WATER) - return 1; - return 0; -} -*/ - #define _pcheck(p) traceline(p+z_up,p-z_down,MOVE_WORLDONLY,self); if (!floor_ok(trace_endpos)) return 1 float edge_check(vector point,float fsize) { @@ -259,7 +206,7 @@ vector pathlib_swimnode(vector start,vector end,float doedge) end.y = fsnap(end.y, pathlib_gridsize); if(pointcontents(end) == CONTENT_EMPTY) - return pathlib_wateroutnode( start, end); + return pathlib_wateroutnode( start, end, doedge); tracebox(start, walknode_boxmin,walknode_boxmax, end, MOVE_WORLDONLY, self); if(trace_fraction == 1) @@ -519,7 +466,6 @@ float pathlib_h_diagonal3(vector a,vector b) return h; } -//#define PATHLIB_USE_NODESCRAP const float PATHLIB_NODEEXPIRE = 0.05; float pathlib_scraplist_cnt; entity newnode() @@ -541,7 +487,6 @@ entity newnode() #endif ++pathlib_made_cnt; n = spawn(); -#ifdef PATHLIB_NODEEXPIRE n.think = SUB_Remove; n.nextthink = time + PATHLIB_NODEEXPIRE; return n; @@ -736,7 +681,7 @@ float pathlib_expandnode_star(entity node, vector start, vector goal) { vector point; vector where; - float nodecnt; + float nodecnt = 0; where = node.origin; @@ -1044,6 +989,3 @@ entity pathlib_astar(vector from,vector to) return world; } - - - diff --git a/qcsrc/server/pathlib.qh b/qcsrc/server/pathlib.qh new file mode 100644 index 000000000..da4ae0cf8 --- /dev/null +++ b/qcsrc/server/pathlib.qh @@ -0,0 +1,48 @@ +#ifndef PATHLIB_H +#define PATHLIB_H + +//#define PATHLIB_RDFIELDS +#ifdef PATHLIB_RDFIELDS + #define path_next swampslug + #define path_prev lasertarget +#else + .entity path_next; + .entity path_prev; +#endif + +entity openlist; +entity closedlist; +entity scraplist; + +.float pathlib_node_g; +.float pathlib_node_h; +.float pathlib_node_f; + +float pathlib_open_cnt; +float pathlib_closed_cnt; +float pathlib_made_cnt; +float pathlib_merge_cnt; +float pathlib_recycle_cnt; +float pathlib_searched_cnt; + +float pathlib_bestopen_seached; +float pathlib_bestcash_hits; +float pathlib_bestcash_saved; + +float pathlib_gridsize; + +float pathlib_movecost; +float pathlib_movecost_diag; +float pathlib_movecost_waterfactor; + +float pathlib_edge_check_size; + +float pathlib_foundgoal; +entity goal_node; + +entity best_open_node; +.float is_path_node; + +#define inwater(point) (pointcontents(point) == CONTENT_WATER) + +#endif diff --git a/qcsrc/server/pathlib/costs.qc b/qcsrc/server/pathlib/costs.qc index 0b2ee4559..878e8fd5b 100644 --- a/qcsrc/server/pathlib/costs.qc +++ b/qcsrc/server/pathlib/costs.qc @@ -1,3 +1,5 @@ +#include "../pathlib.qh" + float pathlib_g_static(entity parent,vector to, float static_cost) { return parent.pathlib_node_g + static_cost; diff --git a/qcsrc/server/pathlib/debug.qc b/qcsrc/server/pathlib/debug.qc index 4f73b2473..5c97cf7ac 100644 --- a/qcsrc/server/pathlib/debug.qc +++ b/qcsrc/server/pathlib/debug.qc @@ -1,3 +1,4 @@ +#include "../pathlib.qh" #ifdef TURRET_DEBUG void mark_error(vector where,float lifetime); @@ -65,6 +66,8 @@ void pathlib_showsquare2(entity node ,vector ncolor,float align) } } +void SUB_Remove(); + void pathlib_showsquare(vector where,float goodsquare,float _lifetime) { entity s; diff --git a/qcsrc/server/pathlib/expandnode.qc b/qcsrc/server/pathlib/expandnode.qc index 4f9481650..9d49be9ec 100644 --- a/qcsrc/server/pathlib/expandnode.qc +++ b/qcsrc/server/pathlib/expandnode.qc @@ -1,3 +1,6 @@ +#include "pathlib.qh" +#include "utility.qh" + vector plib_points2[8]; vector plib_points[8]; float plib_fvals[8]; diff --git a/qcsrc/server/pathlib/main.qc b/qcsrc/server/pathlib/main.qc index 5fef3251f..bac317e94 100644 --- a/qcsrc/server/pathlib/main.qc +++ b/qcsrc/server/pathlib/main.qc @@ -1,3 +1,9 @@ +#include "../_.qh" + +#include "pathlib.qh" +#include "utility.qh" +#include "../command/common.qh" + void pathlib_deletepath(entity start) { entity e; diff --git a/qcsrc/server/pathlib/main.qh b/qcsrc/server/pathlib/main.qh new file mode 100644 index 000000000..177c432cf --- /dev/null +++ b/qcsrc/server/pathlib/main.qh @@ -0,0 +1,5 @@ +#ifndef PATHLIB_MAIN_H +#define PATHLIB_MAIN_H +float buildpath_nodefilter_none(vector n,vector c,vector p); +entity path_build(entity next, vector where, entity prev, entity start); +#endif diff --git a/qcsrc/server/pathlib/movenode.qc b/qcsrc/server/pathlib/movenode.qc index 1da6fe167..884b7951b 100644 --- a/qcsrc/server/pathlib/movenode.qc +++ b/qcsrc/server/pathlib/movenode.qc @@ -1,3 +1,8 @@ +#include "../_.qh" + +#include "pathlib.qh" +#include "utility.qh" + vector pathlib_wateroutnode(vector start,vector end, float doedge) { vector surface; diff --git a/qcsrc/server/pathlib/path_waypoint.qc b/qcsrc/server/pathlib/path_waypoint.qc index 231c14f21..1bc115dc0 100644 --- a/qcsrc/server/pathlib/path_waypoint.qc +++ b/qcsrc/server/pathlib/path_waypoint.qc @@ -1,3 +1,8 @@ +#include "../bot/waypoints.qh" + +#include "pathlib.qh" +#include "main.qh" + var float pathlib_wpp_open(entity wp, entity child, float cost); void pathlib_wpp_close(entity wp) diff --git a/qcsrc/server/pathlib/pathlib.qh b/qcsrc/server/pathlib/pathlib.qh index d0029bfc4..dbf785266 100644 --- a/qcsrc/server/pathlib/pathlib.qh +++ b/qcsrc/server/pathlib/pathlib.qh @@ -113,10 +113,4 @@ var float pathlib_wpp_waypointcallback(entity wp, entity wp_prev); #include "debug.qc" #endif -#include "utility.qc" -#include "movenode.qc" -#include "costs.qc" -#include "expandnode.qc" -#include "main.qc" -#include "path_waypoint.qc" #endif diff --git a/qcsrc/server/pathlib/utility.qc b/qcsrc/server/pathlib/utility.qc index 7bdc70877..4851dbcc0 100644 --- a/qcsrc/server/pathlib/utility.qc +++ b/qcsrc/server/pathlib/utility.qc @@ -1,3 +1,7 @@ +#include "utility.qh" + +#include "pathlib.qh" + float fsnap(float val,float fsize) { return rint(val / fsize) * fsize; diff --git a/qcsrc/server/pathlib/utility.qh b/qcsrc/server/pathlib/utility.qh new file mode 100644 index 000000000..bf72549a0 --- /dev/null +++ b/qcsrc/server/pathlib/utility.qh @@ -0,0 +1,6 @@ +#ifndef PATHLIB_UTILITY +#define PATHLIB_UTILITY +float fsnap(float val,float fsize); +entity pathlib_nodeatpoint(vector where); +float tile_check_plus2(vector where); +#endif diff --git a/qcsrc/server/portals.qc b/qcsrc/server/portals.qc index 8d061cdb8..e82c049a3 100644 --- a/qcsrc/server/portals.qc +++ b/qcsrc/server/portals.qc @@ -1,22 +1,18 @@ -#if defined(CSQC) -#elif defined(MENUQC) -#elif defined(SVQC) - #include "../dpdefs/progsdefs.qh" - #include "../dpdefs/dpextensions.qh" - #include "../warpzonelib/anglestransform.qh" - #include "../warpzonelib/util_server.qh" - #include "../common/constants.qh" - #include "../common/util.qh" - #include "../common/weapons/weapons.qh" - #include "autocvars.qh" - #include "defs.qh" - #include "../common/notifications.qh" - #include "../common/deathtypes.qh" - #include "mutators/mutators_include.qh" - #include "../csqcmodellib/sv_model.qh" - #include "portals.qh" - #include "g_hook.qh" -#endif +#include "portals.qh" +#include "_.qh" + +#include "g_hook.qh" +#include "g_subs.qh" +#include "mutators/mutators_include.qh" +#include "t_teleporters.qh" +#include "../common/constants.qh" +#include "../common/deathtypes.qh" +#include "../common/notifications.qh" +#include "../common/util.qh" +#include "../common/weapons/weapons.qh" +#include "../csqcmodellib/sv_model.qh" +#include "../warpzonelib/anglestransform.qh" +#include "../warpzonelib/util_server.qh" #define PORTALS_ARE_NOT_SOLID diff --git a/qcsrc/server/progs.src b/qcsrc/server/progs.src index 85e75cda9..f288934a2 100644 --- a/qcsrc/server/progs.src +++ b/qcsrc/server/progs.src @@ -60,7 +60,16 @@ t_swamp.qc t_teleporters.qc waypointsprites.qc +bot/aim.qc bot/bot.qc +bot/navigation.qc +bot/scripting.qc +bot/waypoints.qc + +bot/havocbot/havocbot.qc +bot/havocbot/role_keyhunt.qc +bot/havocbot/role_onslaught.qc +bot/havocbot/roles.qc command/banning.qc command/cmd.qc @@ -73,6 +82,13 @@ command/vote.qc mutators/mutators_include.qc mutators/mutators.qc +pathlib/costs.qc +pathlib/expandnode.qc +pathlib/main.qc +pathlib/movenode.qc +pathlib/path_waypoint.qc +pathlib/utility.qc + weapons/accuracy.qc weapons/common.qc weapons/csqcprojectile.qc // TODO diff --git a/qcsrc/server/race.qc b/qcsrc/server/race.qc index bb7f0eccc..8e4a5bdc3 100644 --- a/qcsrc/server/race.qc +++ b/qcsrc/server/race.qc @@ -1,4 +1,18 @@ #include "race.qh" +#include "_.qh" + +#include "cl_client.qh" +#include "portals.qh" +#include "scores.qh" +#include "spawnpoints.qh" +#include "waypointsprites.qh" +#include "bot/waypoints.qh" +#include "bot/navigation.qh" +#include "command/getreplies.qh" +#include "../common/deathtypes.qh" +#include "../common/notifications.qh" +#include "../common/mapinfo.qh" +#include "../warpzonelib/util_server.qh" void W_Porto_Fail(float failhard); @@ -79,7 +93,6 @@ void spawnfunc_target_checkpoint(); .float race_penalty_accumulator; .string race_penalty_reason; .float race_checkpoint; // player: next checkpoint that has to be reached -.float race_laptime; .entity race_lastpenalty; .entity sprite; @@ -176,6 +189,27 @@ void race_send_recordtime(float msg) WriteInt24_t(msg, race_readTime(GetMapname(), 1)); } + +void race_send_speedaward(float msg) +{ + // send the best speed of the round + WriteByte(msg, SVC_TEMPENTITY); + WriteByte(msg, TE_CSQC_RACE); + WriteByte(msg, RACE_NET_SPEED_AWARD); + WriteInt24_t(msg, floor(speedaward_speed+0.5)); + WriteString(msg, speedaward_holder); +} + +void race_send_speedaward_alltimebest(float msg) +{ + // send the best speed + WriteByte(msg, SVC_TEMPENTITY); + WriteByte(msg, TE_CSQC_RACE); + WriteByte(msg, RACE_NET_SPEED_AWARD_BEST); + WriteInt24_t(msg, floor(speedaward_alltimebest+0.5)); + WriteString(msg, speedaward_alltimebest_holder); +} + void race_SendRankings(float pos, float prevpos, float del, float msg) { WriteByte(msg, SVC_TEMPENTITY); diff --git a/qcsrc/server/race.qh b/qcsrc/server/race.qh index bfdc9be43..47c1db4a3 100644 --- a/qcsrc/server/race.qh +++ b/qcsrc/server/race.qh @@ -10,6 +10,7 @@ float race_timelimit; .float race_place; .float race_started; .float race_completed; +.float race_laptime; float race_completing; .float race_movetime; // for reading @@ -29,4 +30,26 @@ float race_GetFractionalLapCount(entity e); float race_readTime(string map, float pos); string race_readUID(string map, float pos); string race_readName(string map, float pos); +void race_ClearRecords(); +void race_SendNextCheckpoint(entity e, float spec); +void race_PreparePlayer(); +void race_send_recordtime(float msg); +void race_send_speedaward(float msg); + +float speedaward_speed; +string speedaward_holder; +string speedaward_uid; + +float speedaward_alltimebest; +string speedaward_alltimebest_holder; +string speedaward_alltimebest_uid; + +void race_send_speedaward(float msg); + +void race_send_speedaward_alltimebest(float msg); + +void race_SendRankings(float pos, float prevpos, float del, float msg); + +void race_RetractPlayer(); + #endif diff --git a/qcsrc/server/round_handler.qc b/qcsrc/server/round_handler.qc index 70d2d144d..0e6535337 100644 --- a/qcsrc/server/round_handler.qc +++ b/qcsrc/server/round_handler.qc @@ -1,12 +1,8 @@ -#if defined(CSQC) -#elif defined(MENUQC) -#elif defined(SVQC) - #include "../dpdefs/progsdefs.qh" - #include "../dpdefs/dpextensions.qh" - #include "../common/util.qh" - #include "defs.qh" - #include "round_handler.qh" -#endif +#include "round_handler.qh" +#include "_.qh" + +#include "command/vote.qh" +#include "../common/util.qh" void round_handler_Think() { diff --git a/qcsrc/server/scores.qc b/qcsrc/server/scores.qc index a4e3245e6..19fed17ec 100644 --- a/qcsrc/server/scores.qc +++ b/qcsrc/server/scores.qc @@ -1,4 +1,10 @@ #include "scores.qh" +#include "_.qh" + +#include "command/common.qh" +#include "mutators/mutators_include.qh" +#include "../common/playerstats.qh" +#include "../common/teams.qh" .entity scorekeeper; entity teamscorekeepers[16]; diff --git a/qcsrc/server/scores.qh b/qcsrc/server/scores.qh index ff0555cad..8c9af4534 100644 --- a/qcsrc/server/scores.qh +++ b/qcsrc/server/scores.qh @@ -1,6 +1,8 @@ #ifndef SCORES_H #define SCORES_H +#include "../common/constants.qh" + entity scores_initialized; // non-world when scores labels/rules have been set .float scores[MAX_SCORE]; .float teamscores[MAX_TEAMSCORE]; diff --git a/qcsrc/server/scores_rules.qc b/qcsrc/server/scores_rules.qc index 4d5296c81..e5c426de3 100644 --- a/qcsrc/server/scores_rules.qc +++ b/qcsrc/server/scores_rules.qc @@ -1,14 +1,9 @@ -#if defined(CSQC) -#elif defined(MENUQC) -#elif defined(SVQC) - #include "../dpdefs/progsdefs.qh" - #include "../common/constants.qh" - #include "autocvars.qh" - #include "defs.qh" - #include "scores.qh" -#endif - -//float c1, c2, c3, c4; +#include "scores_rules.qh" +#include "_.qh" + +#include "cl_client.qh" +#include "scores.qh" + void CheckAllowedTeams (entity for_whom); // NOTE: SP_ constants may not be >= MAX_SCORE; ST_constants may not be >= MAX_TEAMSCORE diff --git a/qcsrc/server/scores_rules.qh b/qcsrc/server/scores_rules.qh new file mode 100644 index 000000000..b307eebfb --- /dev/null +++ b/qcsrc/server/scores_rules.qh @@ -0,0 +1,8 @@ +#ifndef SCORES_RULES_H +#define SCORES_RULES_H + +void ScoreRules_basics(float teams, float sprio, float stprio, float score_enabled); +void ScoreRules_basics_end(); +void ScoreRules_generic(); + +#endif diff --git a/qcsrc/server/secret.qc b/qcsrc/server/secret.qc index 30fbedc49..853477bb8 100644 --- a/qcsrc/server/secret.qc +++ b/qcsrc/server/secret.qc @@ -1,11 +1,8 @@ -#if defined(CSQC) -#elif defined(MENUQC) -#elif defined(SVQC) - #include "../dpdefs/progsdefs.qh" - #include "../common/util.qh" - #include "defs.qh" - #include "secret.qh" -#endif +#include "secret.qh" +#include "_.qh" + +#include "g_triggers.qh" +#include "../common/util.qh" void secrets_setstatus() { self.stat_secrets_total = secrets_total; diff --git a/qcsrc/server/spawnpoints.qc b/qcsrc/server/spawnpoints.qc index 91add1a40..8f656d731 100644 --- a/qcsrc/server/spawnpoints.qc +++ b/qcsrc/server/spawnpoints.qc @@ -1,19 +1,13 @@ -#if defined(CSQC) -#elif defined(MENUQC) -#elif defined(SVQC) - #include "../dpdefs/progsdefs.qh" - #include "../dpdefs/dpextensions.qh" - #include "../warpzonelib/util_server.qh" - #include "../common/constants.qh" - #include "../common/teams.qh" - #include "../common/util.qh" - #include "autocvars.qh" - #include "constants.qh" - #include "defs.qh" - #include "mutators/mutators_include.qh" - #include "spawnpoints.qh" - #include "race.qh" -#endif +#include "spawnpoints.qh" +#include "_.qh" + +#include "mutators/mutators_include.qh" +#include "g_world.qh" +#include "race.qh" +#include "../common/constants.qh" +#include "../common/teams.qh" +#include "../common/util.qh" +#include "../warpzonelib/util_server.qh" float SpawnPoint_Send(entity to, int sf) { diff --git a/qcsrc/server/steerlib.qc b/qcsrc/server/steerlib.qc index ec76dfef2..f102017b5 100644 --- a/qcsrc/server/steerlib.qc +++ b/qcsrc/server/steerlib.qc @@ -5,8 +5,6 @@ #include "../dpdefs/dpextensions.qh" #endif -.vector steerto; - /** Uniform pull towards a point **/ diff --git a/qcsrc/server/steerlib.qh b/qcsrc/server/steerlib.qh new file mode 100644 index 000000000..fcd35ba78 --- /dev/null +++ b/qcsrc/server/steerlib.qh @@ -0,0 +1,10 @@ +#ifndef STEERLIB_H +#define STEERLIB_H + +.vector steerto; + +vector steerlib_arrive(vector point,float maximal_distance); +vector steerlib_attract2(vector point, float min_influense,float max_distance,float max_influense); +vector steerlib_pull(vector point); + +#endif diff --git a/qcsrc/server/sv_main.qc b/qcsrc/server/sv_main.qc index c2d3dc7dd..5779a511d 100644 --- a/qcsrc/server/sv_main.qc +++ b/qcsrc/server/sv_main.qc @@ -1,26 +1,31 @@ -#if defined(CSQC) -#elif defined(MENUQC) -#elif defined(SVQC) - #include "../dpdefs/progsdefs.qh" - #include "../dpdefs/dpextensions.qh" - #include "../warpzonelib/common.qh" - #include "../warpzonelib/server.qh" - #include "../common/constants.qh" - #include "../common/util.qh" - #include "../common/weapons/weapons.qh" - #include "weapons/csqcprojectile.qh" - #include "autocvars.qh" - #include "constants.qh" - #include "defs.qh" - #include "../common/deathtypes.qh" - #include "mutators/mutators_include.qh" - #include "vehicles/vehicles_def.qh" - #include "../common/mapinfo.qh" - #include "command/common.qh" - #include "../csqcmodellib/sv_model.qh" - #include "anticheat.qh" - #include "g_hook.qh" -#endif +#include "_.qh" + +#include "anticheat.qh" +#include "g_hook.qh" +#include "g_world.qh" + +#include "bot/bot.qh" +#include "bot/waypoints.qh" + +#include "command/common.qh" + +#include "mutators/mutators_include.qh" +#include "vehicles/vehicles_def.qh" +#include "weapons/csqcprojectile.qh" + +#include "../common/constants.qh" +#include "../common/deathtypes.qh" +#include "../common/mapinfo.qh" +#include "../common/util.qh" + +#include "../common/weapons/weapons.qh" + +#include "../csqcmodellib/sv_model.qh" + +#include "../warpzonelib/common.qh" +#include "../warpzonelib/server.qh" + +.float lastground; void CreatureFrame (void) { diff --git a/qcsrc/server/t_halflife.qc b/qcsrc/server/t_halflife.qc index 681c5dc7d..754c52b49 100644 --- a/qcsrc/server/t_halflife.qc +++ b/qcsrc/server/t_halflife.qc @@ -1,11 +1,10 @@ -#if defined(CSQC) -#elif defined(MENUQC) -#elif defined(SVQC) - #include "../dpdefs/progsdefs.qh" - #include "../warpzonelib/util_server.qh" - #include "defs.qh" - #include "vehicles/vehicles_def.qh" -#endif +#include "_.qh" + +#include "../warpzonelib/util_server.qh" +#include "vehicles/vehicles_def.qh" + +.float ladder_time; +.entity ladder_entity; .float roomtype; .float radius; diff --git a/qcsrc/server/t_items.qc b/qcsrc/server/t_items.qc index 8a5ac17b1..a68354a1a 100644 --- a/qcsrc/server/t_items.qc +++ b/qcsrc/server/t_items.qc @@ -1,12 +1,18 @@ #include "t_items.qh" #if defined(SVQC) - #include "autocvars.qh" - #include "constants.qh" - #include "defs.qh" + #include "_.qh" + + #include "g_subs.qh" + #include "waypointsprites.qh" + + #include "bot/bot.qh" + #include "bot/waypoints.qh" #include "mutators/mutators_include.qh" + #include "weapons/common.qh" + #include "weapons/selection.qh" #include "weapons/weaponsystem.qh" #include "../common/constants.qh" @@ -18,9 +24,6 @@ #include "../common/weapons/weapons.qh" - #include "../dpdefs/dpextensions.qh" - #include "../dpdefs/progsdefs.qh" - #include "../warpzonelib/util_server.qh" #endif diff --git a/qcsrc/server/t_items.qh b/qcsrc/server/t_items.qh index ae4ecdb76..429f3c311 100644 --- a/qcsrc/server/t_items.qh +++ b/qcsrc/server/t_items.qh @@ -63,6 +63,10 @@ const int ISF_SIZE = 128; .int ItemStatus; +void spawnfunc_item_strength(); +void spawnfunc_item_invincible(); +void spawnfunc_item_armor_small(); + #ifdef CSQC float autocvar_cl_animate_items = 1; diff --git a/qcsrc/server/t_jumppads.qc b/qcsrc/server/t_jumppads.qc index 92af1cdd0..018a7c259 100644 --- a/qcsrc/server/t_jumppads.qc +++ b/qcsrc/server/t_jumppads.qc @@ -1,4 +1,16 @@ #include "t_jumppads.qh" +#include "_.qh" + +#include "g_subs.qh" + +#include "bot/navigation.qh" +#include "bot/waypoints.qh" + +#include "weapons/csqcprojectile.qh" + +#include "../common/animdecide.qh" + +#include "../warpzonelib/util_server.qh" void trigger_push_use() { diff --git a/qcsrc/server/t_plats.qc b/qcsrc/server/t_plats.qc index ebe1676c7..73bc327ce 100644 --- a/qcsrc/server/t_plats.qc +++ b/qcsrc/server/t_plats.qc @@ -1,21 +1,27 @@ -#if defined(CSQC) -#elif defined(MENUQC) -#elif defined(SVQC) - #include "../dpdefs/progsdefs.qh" - #include "../dpdefs/dpextensions.qh" - #include "../warpzonelib/mathlib.qh" - #include "../warpzonelib/common.qh" - #include "../warpzonelib/util_server.qh" - #include "../common/constants.qh" - #include "../common/util.qh" - #include "../common/weapons/weapons.qh" - #include "constants.qh" - #include "defs.qh" - #include "../common/notifications.qh" - #include "../common/deathtypes.qh" - #include "command/common.qh" - #include "../csqcmodellib/sv_model.qh" -#endif +#include "_.qh" + +#include "bot/bot.qh" + +#include "command/common.qh" + +#include "g_damage.qh" +#include "g_subs.qh" +#include "item_key.qh" + +#include "../common/constants.qh" +#include "../common/deathtypes.qh" +#include "../common/notifications.qh" +#include "../common/util.qh" + +#include "../common/weapons/weapons.qh" + +#include "../csqcmodellib/sv_model.qh" + +#include "../warpzonelib/common.qh" +#include "../warpzonelib/mathlib.qh" +#include "../warpzonelib/util_server.qh" + +.float height; .float dmgtime2; void generic_plat_blocked() diff --git a/qcsrc/server/t_quake.qc b/qcsrc/server/t_quake.qc index 9b25c8860..b81e0c07d 100644 --- a/qcsrc/server/t_quake.qc +++ b/qcsrc/server/t_quake.qc @@ -1,3 +1,5 @@ +#include "_.qh" + #include "../common/weapons/weapons.qc" //*********************** diff --git a/qcsrc/server/t_quake3.qc b/qcsrc/server/t_quake3.qc index ed90bf054..3a67bc1fd 100644 --- a/qcsrc/server/t_quake3.qc +++ b/qcsrc/server/t_quake3.qc @@ -1,3 +1,5 @@ +#include "_.qh" + #include "../common/weapons/weapons.qc" //*********************** diff --git a/qcsrc/server/t_swamp.qc b/qcsrc/server/t_swamp.qc index b63e7ffe3..9176f61b0 100644 --- a/qcsrc/server/t_swamp.qc +++ b/qcsrc/server/t_swamp.qc @@ -1,10 +1,10 @@ #if defined(CSQC) #elif defined(MENUQC) #elif defined(SVQC) - #include "../dpdefs/progsdefs.qh" + #include "_.qh" + #include "../warpzonelib/util_server.qh" #include "../common/weapons/weapons.qh" - #include "defs.qh" #include "../common/deathtypes.qh" #endif diff --git a/qcsrc/server/t_teleporters.qc b/qcsrc/server/t_teleporters.qc index 46df0eb78..5a013b7d3 100644 --- a/qcsrc/server/t_teleporters.qc +++ b/qcsrc/server/t_teleporters.qc @@ -1,4 +1,5 @@ #include "t_teleporters.qh" +#include "_.qh" #if defined(CSQC) #elif defined(MENUQC) @@ -9,9 +10,6 @@ #include "../common/constants.qh" #include "../common/util.qh" #include "weapons/csqcprojectile.qh" - #include "autocvars.qh" - #include "constants.qh" - #include "defs.qh" #include "../common/deathtypes.qh" #include "tturrets/include/turrets_early.qh" #include "vehicles/vehicles_def.qh" diff --git a/qcsrc/server/target_music.qc b/qcsrc/server/target_music.qc index be476d758..12ee04ad2 100644 --- a/qcsrc/server/target_music.qc +++ b/qcsrc/server/target_music.qc @@ -1,13 +1,6 @@ -#if defined(CSQC) -#elif defined(MENUQC) -#elif defined(SVQC) - #include "../dpdefs/progsdefs.qh" - #include "../dpdefs/dpextensions.qh" - #include "../common/constants.qh" - #include "constants.qh" - #include "defs.qh" -#endif +#include "_.qh" +.float volume; .float lifetime; // values: // volume diff --git a/qcsrc/server/target_spawn.qc b/qcsrc/server/target_spawn.qc index cba5f365d..e89b5c0c5 100644 --- a/qcsrc/server/target_spawn.qc +++ b/qcsrc/server/target_spawn.qc @@ -1,11 +1,7 @@ -#if defined(CSQC) -#elif defined(MENUQC) -#elif defined(SVQC) - #include "../dpdefs/progsdefs.qh" - #include "../dpdefs/dpextensions.qh" - #include "../common/util.qh" - #include "defs.qh" -#endif +#include "_.qh" + +.entity pusher; +.float pushltime; // spawner entity // "classname" "target_spawn" diff --git a/qcsrc/server/teamplay.qc b/qcsrc/server/teamplay.qc index ba1b4e6ee..7301cf9e0 100644 --- a/qcsrc/server/teamplay.qc +++ b/qcsrc/server/teamplay.qc @@ -1,4 +1,19 @@ #include "teamplay.qh" +#include "_.qh" + +#include "cl_client.qh" +#include "race.qh" +#include "scores.qh" +#include "scores_rules.qh" + +#include "bot/bot.qh" + +#include "command/vote.qh" + +#include "mutators/mutators_include.qh" + +#include "../common/deathtypes.qh" +#include "../common/teams.qh" void TeamchangeFrags(entity e) { diff --git a/qcsrc/server/tturrets/system/system_main.qc b/qcsrc/server/tturrets/system/system_main.qc index ad0b68521..b8cfea267 100644 --- a/qcsrc/server/tturrets/system/system_main.qc +++ b/qcsrc/server/tturrets/system/system_main.qc @@ -1,3 +1,8 @@ +#include "../../_.qh" + +#include "../../g_damage.qh" +#include "../../bot/bot.qh" + #define cvar_base "g_turrets_unit_" .float clientframe; void turrets_setframe(float _frame, float client_only) diff --git a/qcsrc/server/tturrets/units/unit_ewheel.qc b/qcsrc/server/tturrets/units/unit_ewheel.qc index 7eb1622ba..4133ae97d 100644 --- a/qcsrc/server/tturrets/units/unit_ewheel.qc +++ b/qcsrc/server/tturrets/units/unit_ewheel.qc @@ -1,3 +1,5 @@ +#include "../../bot/navigation.qh" + const float ewheel_amin_stop = 0; const float ewheel_amin_fwd_slow = 1; const float ewheel_amin_fwd_fast = 2; diff --git a/qcsrc/server/tturrets/units/unit_machinegun.qc b/qcsrc/server/tturrets/units/unit_machinegun.qc index d235dfb32..21c6acfcc 100644 --- a/qcsrc/server/tturrets/units/unit_machinegun.qc +++ b/qcsrc/server/tturrets/units/unit_machinegun.qc @@ -1,3 +1,5 @@ +void W_MachineGun_MuzzleFlash(void); + void spawnfunc_turret_machinegun(); void turret_machinegun_std_init(); void turret_machinegun_attack(); diff --git a/qcsrc/server/tturrets/units/unit_phaser.qc b/qcsrc/server/tturrets/units/unit_phaser.qc index a5aafda8f..33aa484ba 100644 --- a/qcsrc/server/tturrets/units/unit_phaser.qc +++ b/qcsrc/server/tturrets/units/unit_phaser.qc @@ -1,3 +1,5 @@ +#include "../../_.qh" + void spawnfunc_turret_phaser(); void turret_phaser_dinit(); void turret_phaser_attack(); diff --git a/qcsrc/server/tturrets/units/unit_targettrigger.qc b/qcsrc/server/tturrets/units/unit_targettrigger.qc index 0f2de3c86..205cd0b53 100644 --- a/qcsrc/server/tturrets/units/unit_targettrigger.qc +++ b/qcsrc/server/tturrets/units/unit_targettrigger.qc @@ -1,3 +1,5 @@ +#include "../../g_subs.qh" + void spawnfunc_turret_targettrigger(); void turret_targettrigger_touch(); diff --git a/qcsrc/server/tturrets/units/unit_tessla.qc b/qcsrc/server/tturrets/units/unit_tessla.qc index 4989b2445..c95de1373 100644 --- a/qcsrc/server/tturrets/units/unit_tessla.qc +++ b/qcsrc/server/tturrets/units/unit_tessla.qc @@ -1,3 +1,5 @@ +#include "../../csqceffects.qh" + void spawnfunc_turret_tesla(); void turret_tesla_dinit(); void turret_tesla_fire(); diff --git a/qcsrc/server/tturrets/units/unit_walker.qc b/qcsrc/server/tturrets/units/unit_walker.qc index f76d11923..16141064e 100644 --- a/qcsrc/server/tturrets/units/unit_walker.qc +++ b/qcsrc/server/tturrets/units/unit_walker.qc @@ -1,3 +1,9 @@ +#include "../../_.qh" + +#include "../../movelib.qh" +#include "../../steerlib.qh" +#include "../../t_teleporters.qh" + const float ANIM_NO = 0; const float ANIM_TURN = 1; const float ANIM_WALK = 2; diff --git a/qcsrc/server/vehicles/bumblebee.qc b/qcsrc/server/vehicles/bumblebee.qc index c9edecf56..dfbcd4c36 100644 --- a/qcsrc/server/vehicles/bumblebee.qc +++ b/qcsrc/server/vehicles/bumblebee.qc @@ -323,6 +323,7 @@ void bumb_regen() } +.vector hook_start, hook_end; float bumb_pilot_frame() { entity pilot, vehic; diff --git a/qcsrc/server/vehicles/racer.qc b/qcsrc/server/vehicles/racer.qc index b96419584..49cebfc46 100644 --- a/qcsrc/server/vehicles/racer.qc +++ b/qcsrc/server/vehicles/racer.qc @@ -447,6 +447,8 @@ float racer_frame() return 1; } +.float lastpushtime; + void racer_think() { self.nextthink = time; diff --git a/qcsrc/server/vehicles/vehicles.qc b/qcsrc/server/vehicles/vehicles.qc index 5e6bf8dfb..3778b0405 100644 --- a/qcsrc/server/vehicles/vehicles.qc +++ b/qcsrc/server/vehicles/vehicles.qc @@ -1,3 +1,12 @@ +#include "vehicles.qh" + +#include "../cl_player.qh" +#include "../waypointsprites.qh" + +#include "../bot/waypoints.qh" + +.float() PlayerPhysplug; + float autocvar_g_vehicles_crush_dmg; float autocvar_g_vehicles_crush_force; float autocvar_g_vehicles_delayspawn; diff --git a/qcsrc/test/compilationunit.sh b/qcsrc/test/compilationunit.sh index 7af726f4c..09539c6d7 100755 --- a/qcsrc/test/compilationunit.sh +++ b/qcsrc/test/compilationunit.sh @@ -3,6 +3,11 @@ set -eu cd "$(dirname "$0")" cd .. +declare -a NOWARN=( + '-Wno-field-redeclared' + '-Wno-unused-variable' + '-Wno-implicit-function-pointer' +) declare QCC=../../../gmqcc/gmqcc function check() { @@ -10,15 +15,15 @@ function check() { declare -la predefs=("${!2}") find "$base" -type f -name '*.qc' -print0 | sort -z | while IFS= read -r -d '' file; do echo "$file" - ${QCC} -std=gmqcc -fftepp -fftepp-predefs -futf8 -O3 "${predefs[@]}" "$file" >/dev/null + ${QCC} -std=gmqcc -fftepp -fftepp-predefs -Werror -Wall "${NOWARN[@]}" -futf8 -O3 "${predefs[@]}" "$file" >/dev/null done } clientdefs=("-DCSQC" "common/util-pre.qh" "dpdefs/csprogsdefs.qh") check "client" clientdefs[@] -# serverdefs=("-DSVQC" "common/util-pre.qh" "server/sys-pre.qh" "dpdefs/progsdefs.qh" "dpdefs/dpextensions.qh" "server/sys-post.qh" "server/defs.qh" "server/autocvars.qh") -# check "server" serverdefs[@] +serverdefs=("-DSVQC" "common/util-pre.qh" "server/sys-pre.qh" "dpdefs/progsdefs.qh" "dpdefs/dpextensions.qh" "server/sys-post.qh" "server/defs.qh" "server/autocvars.qh") +check "server" serverdefs[@] # menudefs=("-DMENUQC" "common/util-pre.qh" "dpdefs/menudefs.qh" "menu/oo/interface.qc" "menu/oo/implementation.qc") # check "menu" menudefs[@] -- 2.39.2