From 5b47b78775c2559fc9b4f0f643a2625c48c410d4 Mon Sep 17 00:00:00 2001 From: Lyberta Date: Tue, 17 Jul 2018 15:01:15 +0300 Subject: [PATCH] Split gamemodes into cl and sv. --- .../gamemodes/gamemode/assault/_mod.inc | 4 +- .../common/gamemodes/gamemode/assault/_mod.qh | 4 +- .../assault/{assault.qc => sv_assault.qc} | 5 +- .../assault/{assault.qh => sv_assault.qh} | 2 - .../gamemodes/gamemode/clanarena/_mod.inc | 4 +- .../gamemodes/gamemode/clanarena/_mod.qh | 4 +- .../{clanarena.qc => sv_clanarena.qc} | 5 +- .../{clanarena.qh => sv_clanarena.qh} | 2 - qcsrc/common/gamemodes/gamemode/ctf/_mod.inc | 4 +- qcsrc/common/gamemodes/gamemode/ctf/_mod.qh | 3 + qcsrc/common/gamemodes/gamemode/ctf/ctf.qh | 169 ------------------ .../gamemode/ctf/{ctf.qc => sv_ctf.qc} | 5 +- qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qh | 169 ++++++++++++++++++ qcsrc/common/gamemodes/gamemode/cts/_mod.inc | 4 +- qcsrc/common/gamemodes/gamemode/cts/_mod.qh | 4 +- .../gamemode/cts/{cts.qc => sv_cts.qc} | 7 +- .../gamemode/cts/{cts.qh => sv_cts.qh} | 2 - .../gamemodes/gamemode/deathmatch/_mod.inc | 4 +- .../gamemodes/gamemode/deathmatch/_mod.qh | 4 +- .../{deathmatch.qc => sv_deathmatch.qc} | 5 +- .../{deathmatch.qh => sv_deathmatch.qh} | 2 - .../gamemodes/gamemode/domination/_mod.inc | 4 +- .../gamemodes/gamemode/domination/_mod.qh | 4 +- .../{domination.qc => sv_domination.qc} | 5 +- .../{domination.qh => sv_domination.qh} | 2 - .../gamemodes/gamemode/freezetag/_mod.inc | 4 +- .../gamemodes/gamemode/freezetag/_mod.qh | 4 +- .../{freezetag.qc => sv_freezetag.qc} | 6 +- .../{freezetag.qh => sv_freezetag.qh} | 2 - .../gamemodes/gamemode/invasion/_mod.inc | 4 +- .../gamemodes/gamemode/invasion/_mod.qh | 4 +- .../invasion/{invasion.qc => sv_invasion.qc} | 5 +- .../invasion/{invasion.qh => sv_invasion.qh} | 2 - .../gamemodes/gamemode/keepaway/_mod.inc | 4 +- .../gamemodes/gamemode/keepaway/_mod.qh | 4 +- .../keepaway/{keepaway.qc => sv_keepaway.qc} | 5 +- .../keepaway/{keepaway.qh => sv_keepaway.qh} | 2 - .../gamemodes/gamemode/keyhunt/_mod.inc | 4 +- .../common/gamemodes/gamemode/keyhunt/_mod.qh | 4 +- .../keyhunt/{keyhunt.qc => sv_keyhunt.qc} | 5 +- .../keyhunt/{keyhunt.qh => sv_keyhunt.qh} | 2 - qcsrc/common/gamemodes/gamemode/lms/_mod.inc | 4 +- qcsrc/common/gamemodes/gamemode/lms/_mod.qh | 4 +- .../gamemode/lms/{lms.qc => sv_lms.qc} | 4 +- .../gamemode/lms/{lms.qh => sv_lms.qh} | 2 - qcsrc/common/gamemodes/gamemode/race/_mod.inc | 4 +- qcsrc/common/gamemodes/gamemode/race/_mod.qh | 4 +- .../gamemode/race/{race.qc => sv_race.qc} | 5 +- .../gamemode/race/{race.qh => sv_race.qh} | 2 - qcsrc/common/gamemodes/gamemode/tdm/_mod.inc | 4 +- qcsrc/common/gamemodes/gamemode/tdm/_mod.qh | 4 +- .../gamemode/tdm/{tdm.qc => sv_tdm.qc} | 5 +- .../gamemode/tdm/{tdm.qh => sv_tdm.qh} | 2 - 53 files changed, 260 insertions(+), 272 deletions(-) rename qcsrc/common/gamemodes/gamemode/assault/{assault.qc => sv_assault.qc} (99%) rename qcsrc/common/gamemodes/gamemode/assault/{assault.qh => sv_assault.qh} (98%) rename qcsrc/common/gamemodes/gamemode/clanarena/{clanarena.qc => sv_clanarena.qc} (99%) rename qcsrc/common/gamemodes/gamemode/clanarena/{clanarena.qh => sv_clanarena.qh} (98%) rename qcsrc/common/gamemodes/gamemode/ctf/{ctf.qc => sv_ctf.qc} (99%) create mode 100644 qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qh rename qcsrc/common/gamemodes/gamemode/cts/{cts.qc => sv_cts.qc} (99%) rename qcsrc/common/gamemodes/gamemode/cts/{cts.qh => sv_cts.qh} (95%) rename qcsrc/common/gamemodes/gamemode/deathmatch/{deathmatch.qc => sv_deathmatch.qc} (59%) rename qcsrc/common/gamemodes/gamemode/deathmatch/{deathmatch.qh => sv_deathmatch.qh} (85%) rename qcsrc/common/gamemodes/gamemode/domination/{domination.qc => sv_domination.qc} (99%) rename qcsrc/common/gamemodes/gamemode/domination/{domination.qh => sv_domination.qh} (98%) rename qcsrc/common/gamemodes/gamemode/freezetag/{freezetag.qc => sv_freezetag.qc} (99%) rename qcsrc/common/gamemodes/gamemode/freezetag/{freezetag.qh => sv_freezetag.qh} (97%) rename qcsrc/common/gamemodes/gamemode/invasion/{invasion.qc => sv_invasion.qc} (99%) rename qcsrc/common/gamemodes/gamemode/invasion/{invasion.qh => sv_invasion.qh} (98%) rename qcsrc/common/gamemodes/gamemode/keepaway/{keepaway.qc => sv_keepaway.qc} (99%) rename qcsrc/common/gamemodes/gamemode/keepaway/{keepaway.qh => sv_keepaway.qh} (96%) rename qcsrc/common/gamemodes/gamemode/keyhunt/{keyhunt.qc => sv_keyhunt.qc} (99%) rename qcsrc/common/gamemodes/gamemode/keyhunt/{keyhunt.qh => sv_keyhunt.qh} (97%) rename qcsrc/common/gamemodes/gamemode/lms/{lms.qc => sv_lms.qc} (99%) rename qcsrc/common/gamemodes/gamemode/lms/{lms.qh => sv_lms.qh} (97%) rename qcsrc/common/gamemodes/gamemode/race/{race.qc => sv_race.qc} (99%) rename qcsrc/common/gamemodes/gamemode/race/{race.qh => sv_race.qh} (92%) rename qcsrc/common/gamemodes/gamemode/tdm/{tdm.qc => sv_tdm.qc} (97%) rename qcsrc/common/gamemodes/gamemode/tdm/{tdm.qh => sv_tdm.qh} (96%) diff --git a/qcsrc/common/gamemodes/gamemode/assault/_mod.inc b/qcsrc/common/gamemodes/gamemode/assault/_mod.inc index 1deb03156..e03d3c52e 100644 --- a/qcsrc/common/gamemodes/gamemode/assault/_mod.inc +++ b/qcsrc/common/gamemodes/gamemode/assault/_mod.inc @@ -1,2 +1,4 @@ // generated file; do not modify -#include +#ifdef SVQC + #include +#endif diff --git a/qcsrc/common/gamemodes/gamemode/assault/_mod.qh b/qcsrc/common/gamemodes/gamemode/assault/_mod.qh index 38b426d4a..211daa89e 100644 --- a/qcsrc/common/gamemodes/gamemode/assault/_mod.qh +++ b/qcsrc/common/gamemodes/gamemode/assault/_mod.qh @@ -1,2 +1,4 @@ // generated file; do not modify -#include +#ifdef SVQC + #include +#endif diff --git a/qcsrc/common/gamemodes/gamemode/assault/assault.qc b/qcsrc/common/gamemodes/gamemode/assault/sv_assault.qc similarity index 99% rename from qcsrc/common/gamemodes/gamemode/assault/assault.qc rename to qcsrc/common/gamemodes/gamemode/assault/sv_assault.qc index e7134182e..2613d598b 100644 --- a/qcsrc/common/gamemodes/gamemode/assault/assault.qc +++ b/qcsrc/common/gamemodes/gamemode/assault/sv_assault.qc @@ -1,7 +1,5 @@ -#include "assault.qh" +#include "sv_assault.qh" -// TODO: split into sv_assault -#ifdef SVQC .entity sprite; #define AS_ROUND_DELAY 5 @@ -645,4 +643,3 @@ MUTATOR_HOOKFUNCTION(as, ReadyRestart_Deny) // readyrestart not supported (yet) return true; } -#endif diff --git a/qcsrc/common/gamemodes/gamemode/assault/assault.qh b/qcsrc/common/gamemodes/gamemode/assault/sv_assault.qh similarity index 98% rename from qcsrc/common/gamemodes/gamemode/assault/assault.qh rename to qcsrc/common/gamemodes/gamemode/assault/sv_assault.qh index d949f18b3..0bb121f21 100644 --- a/qcsrc/common/gamemodes/gamemode/assault/assault.qh +++ b/qcsrc/common/gamemodes/gamemode/assault/sv_assault.qh @@ -1,6 +1,5 @@ #pragma once -#ifdef SVQC #include #include @@ -45,4 +44,3 @@ void(entity this, float ratingscale, vector org, float sradius) havocbot_goalrat // predefined spawnfuncs void target_objective_decrease_activate(entity this); -#endif diff --git a/qcsrc/common/gamemodes/gamemode/clanarena/_mod.inc b/qcsrc/common/gamemodes/gamemode/clanarena/_mod.inc index 57dc9b3dd..ce7b59399 100644 --- a/qcsrc/common/gamemodes/gamemode/clanarena/_mod.inc +++ b/qcsrc/common/gamemodes/gamemode/clanarena/_mod.inc @@ -1,2 +1,4 @@ // generated file; do not modify -#include +#ifdef SVQC + #include +#endif diff --git a/qcsrc/common/gamemodes/gamemode/clanarena/_mod.qh b/qcsrc/common/gamemodes/gamemode/clanarena/_mod.qh index 66f23740a..55789f77a 100644 --- a/qcsrc/common/gamemodes/gamemode/clanarena/_mod.qh +++ b/qcsrc/common/gamemodes/gamemode/clanarena/_mod.qh @@ -1,2 +1,4 @@ // generated file; do not modify -#include +#ifdef SVQC + #include +#endif diff --git a/qcsrc/common/gamemodes/gamemode/clanarena/clanarena.qc b/qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qc similarity index 99% rename from qcsrc/common/gamemodes/gamemode/clanarena/clanarena.qc rename to qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qc index a81a23a51..4c889cb24 100644 --- a/qcsrc/common/gamemodes/gamemode/clanarena/clanarena.qc +++ b/qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qc @@ -1,7 +1,5 @@ -#include "clanarena.qh" +#include "sv_clanarena.qh" -// TODO: split into sv_clanarena -#ifdef SVQC float autocvar_g_ca_damage2score_multiplier; bool autocvar_g_ca_spectate_enemies; @@ -503,4 +501,3 @@ MUTATOR_HOOKFUNCTION(ca, SetWeaponArena) // most weapons arena if (M_ARGV(0, string) == "0" || M_ARGV(0, string) == "") M_ARGV(0, string) = "most"; } -#endif diff --git a/qcsrc/common/gamemodes/gamemode/clanarena/clanarena.qh b/qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qh similarity index 98% rename from qcsrc/common/gamemodes/gamemode/clanarena/clanarena.qh rename to qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qh index 8a94acd18..c4755feee 100644 --- a/qcsrc/common/gamemodes/gamemode/clanarena/clanarena.qh +++ b/qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qh @@ -1,6 +1,5 @@ #pragma once -#ifdef SVQC #include #include #include @@ -53,4 +52,3 @@ REGISTER_MUTATOR(ca, false) // should be removed in the future, as other code should not have to care .float caplayer; // 0.5 if scheduled to join the next round -#endif diff --git a/qcsrc/common/gamemodes/gamemode/ctf/_mod.inc b/qcsrc/common/gamemodes/gamemode/ctf/_mod.inc index dcd813569..7bc5a9679 100644 --- a/qcsrc/common/gamemodes/gamemode/ctf/_mod.inc +++ b/qcsrc/common/gamemodes/gamemode/ctf/_mod.inc @@ -1,2 +1,4 @@ // generated file; do not modify -#include +#ifdef SVQC + #include +#endif diff --git a/qcsrc/common/gamemodes/gamemode/ctf/_mod.qh b/qcsrc/common/gamemodes/gamemode/ctf/_mod.qh index c1ddd9731..e7fcea7bc 100644 --- a/qcsrc/common/gamemodes/gamemode/ctf/_mod.qh +++ b/qcsrc/common/gamemodes/gamemode/ctf/_mod.qh @@ -1,2 +1,5 @@ // generated file; do not modify #include +#ifdef SVQC + #include +#endif diff --git a/qcsrc/common/gamemodes/gamemode/ctf/ctf.qh b/qcsrc/common/gamemodes/gamemode/ctf/ctf.qh index 2f9643b4a..3cbd334b2 100644 --- a/qcsrc/common/gamemodes/gamemode/ctf/ctf.qh +++ b/qcsrc/common/gamemodes/gamemode/ctf/ctf.qh @@ -1,174 +1,5 @@ #pragma once -#ifdef SVQC - -void ctf_Initialize(); - -REGISTER_MUTATOR(ctf, false) -{ - MUTATOR_STATIC(); - MUTATOR_ONADD - { - GameRules_teams(true); - GameRules_limit_score(autocvar_capturelimit_override); - GameRules_limit_lead(autocvar_captureleadlimit_override); - - ctf_Initialize(); - } - return 0; -} - -// used in cheats.qc -void ctf_RespawnFlag(entity flag); - -// score rule declarations -const int ST_CTF_CAPS = 1; - -CLASS(Flag, Pickup) - ATTRIB(Flag, m_mins, vector, (PL_MIN_CONST + '0 0 -13') * 1.4); // scaling be damned - ATTRIB(Flag, m_maxs, vector, (PL_MAX_CONST + '0 0 -13') * 1.4); -ENDCLASS(Flag) -Flag CTF_FLAG; STATIC_INIT(Flag) { CTF_FLAG = NEW(Flag); } -void ctf_FlagTouch(entity this, entity toucher) { ITEM_HANDLE(Pickup, CTF_FLAG, this, toucher); } - -// flag constants // for most of these, there is just one question to be asked: WHYYYYY? - -const float FLAG_SCALE = 0.6; - -const float FLAG_THINKRATE = 0.2; -const float FLAG_TOUCHRATE = 0.5; -const float WPFE_THINKRATE = 0.5; - -const vector FLAG_DROP_OFFSET = ('0 0 32'); -const vector FLAG_CARRY_OFFSET = ('-16 0 8'); -#define FLAG_SPAWN_OFFSET ('0 0 1' * (PL_MAX_CONST.z - 13)) -const vector FLAG_WAYPOINT_OFFSET = ('0 0 64'); -const vector FLAG_FLOAT_OFFSET = ('0 0 32'); -const vector FLAG_PASS_ARC_OFFSET = ('0 0 -10'); - -const vector VEHICLE_FLAG_OFFSET = ('0 0 96'); -const float VEHICLE_FLAG_SCALE = 1.0; - -// waypoint colors -#define WPCOLOR_ENEMYFC(t) ((t) ? colormapPaletteColor(t - 1, false) * 0.75 : '1 1 1') -#define WPCOLOR_FLAGCARRIER(t) ((t) ? colormapPaletteColor(t - 1, false) * 0.75 : '1 1 1') -//#define WPCOLOR_FLAGCARRIER(t) (WP_FlagCarrier.m_color) -#define WPCOLOR_DROPPEDFLAG(t) ((t) ? ('0.25 0.25 0.25' + colormapPaletteColor(t - 1, false)) * 0.5 : '1 1 1') - -// sounds -#define snd_flag_taken noise -#define snd_flag_returned noise1 -#define snd_flag_capture noise2 -#define snd_flag_respawn noise3 -.string snd_flag_dropped; -.string snd_flag_touch; -.string snd_flag_pass; - -// score fields -.float score_assist; -.float score_capture; -.float score_drop; // note: negated -.float score_pickup; -.float score_return; -.float score_team_capture; // shouldn't be too high - -// effects -.string toucheffect; -.string passeffect; -.string capeffect; - -// list of flags on the map -entity ctf_worldflaglist; -.entity ctf_worldflagnext; -.entity ctf_staleflagnext; - -// waypoint sprites -.entity wps_helpme; -.entity wps_flagbase; -.entity wps_flagcarrier; -.entity wps_flagdropped; -.entity wps_flagreturn; -.entity wps_enemyflagcarrier; -.float wps_helpme_time; -bool wpforenemy_announced; -float wpforenemy_nextthink; - -// statuses -const int FLAG_BASE = 1; -const int FLAG_DROPPED = 2; -const int FLAG_CARRY = 3; -const int FLAG_PASSING = 4; - -const int DROP_NORMAL = 1; -const int DROP_THROW = 2; -const int DROP_PASS = 3; -const int DROP_RESET = 4; - -const int PICKUP_BASE = 1; -const int PICKUP_DROPPED = 2; - -const int CAPTURE_NORMAL = 1; -const int CAPTURE_DROPPED = 2; - -const int RETURN_TIMEOUT = 1; -const int RETURN_DROPPED = 2; -const int RETURN_DAMAGE = 3; -const int RETURN_SPEEDRUN = 4; -const int RETURN_NEEDKILL = 5; - -bool ctf_Stalemate_Customize(entity this, entity client); - -void ctf_Handle_Throw(entity player, entity receiver, float droptype); - -// flag properties -#define ctf_spawnorigin dropped_origin -bool ctf_stalemate; // indicates that a stalemate is active -float ctf_captimerecord; // record time for capturing the flag -.float ctf_pickuptime; -.float ctf_droptime; -.int ctf_status; // status of the flag (FLAG_BASE, FLAG_DROPPED, FLAG_CARRY declared globally) -.entity ctf_dropper; // don't allow spam of dropping the flag -.int max_flag_health; -.float next_take_time; -.bool ctf_flagdamaged_byworld; -int ctf_teams; -.entity enemy; // when flag is back in the base, it remembers last player who carried/touched the flag, useful to bots - -// passing/throwing properties -.float pass_distance; -.entity pass_sender; -.entity pass_target; -.float throw_antispam; -.float throw_prevtime; -.int throw_count; - -// CaptureShield: If the player is too bad to be allowed to capture, shield them from taking the flag. -.bool ctf_captureshielded; // set to 1 if the player is too bad to be allowed to capture -float ctf_captureshield_min_negscore; // punish at -20 points -float ctf_captureshield_max_ratio; // punish at most 30% of each team -float ctf_captureshield_force; // push force of the shield - -// 1 flag ctf -bool ctf_oneflag; // indicates whether or not a neutral flag has been found - -// bot player logic -const int HAVOCBOT_CTF_ROLE_NONE = 0; -const int HAVOCBOT_CTF_ROLE_DEFENSE = 2; -const int HAVOCBOT_CTF_ROLE_MIDDLE = 4; -const int HAVOCBOT_CTF_ROLE_OFFENSE = 8; -const int HAVOCBOT_CTF_ROLE_CARRIER = 16; -const int HAVOCBOT_CTF_ROLE_RETRIEVER = 32; -const int HAVOCBOT_CTF_ROLE_ESCORT = 64; - -.bool havocbot_cantfindflag; - -void havocbot_role_ctf_setrole(entity bot, int role); - -// team checking -#define CTF_SAMETEAM(a,b) ((autocvar_g_ctf_reverse || (ctf_oneflag && autocvar_g_ctf_oneflag_reverse)) ? DIFF_TEAM(a,b) : SAME_TEAM(a,b)) -#define CTF_DIFFTEAM(a,b) ((autocvar_g_ctf_reverse || (ctf_oneflag && autocvar_g_ctf_oneflag_reverse)) ? SAME_TEAM(a,b) : DIFF_TEAM(a,b)) -#endif - const int CTF_RED_FLAG_TAKEN = 1; const int CTF_RED_FLAG_LOST = 2; const int CTF_RED_FLAG_CARRYING = 3; diff --git a/qcsrc/common/gamemodes/gamemode/ctf/ctf.qc b/qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qc similarity index 99% rename from qcsrc/common/gamemodes/gamemode/ctf/ctf.qc rename to qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qc index 812d5da4e..d77b72087 100644 --- a/qcsrc/common/gamemodes/gamemode/ctf/ctf.qc +++ b/qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qc @@ -1,7 +1,5 @@ -#include "ctf.qh" +#include "sv_ctf.qh" -// TODO: split into sv_ctf -#ifdef SVQC #include #include #include @@ -2773,4 +2771,3 @@ void ctf_Initialize() InitializeEntity(NULL, ctf_DelayedInit, INITPRIO_GAMETYPE); } -#endif diff --git a/qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qh b/qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qh new file mode 100644 index 000000000..61dcb82ae --- /dev/null +++ b/qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qh @@ -0,0 +1,169 @@ +#pragma once + +#include "ctf.qh" + +void ctf_Initialize(); + +REGISTER_MUTATOR(ctf, false) +{ + MUTATOR_STATIC(); + MUTATOR_ONADD + { + GameRules_teams(true); + GameRules_limit_score(autocvar_capturelimit_override); + GameRules_limit_lead(autocvar_captureleadlimit_override); + + ctf_Initialize(); + } + return 0; +} + +// used in cheats.qc +void ctf_RespawnFlag(entity flag); + +// score rule declarations +const int ST_CTF_CAPS = 1; + +CLASS(Flag, Pickup) + ATTRIB(Flag, m_mins, vector, (PL_MIN_CONST + '0 0 -13') * 1.4); // scaling be damned + ATTRIB(Flag, m_maxs, vector, (PL_MAX_CONST + '0 0 -13') * 1.4); +ENDCLASS(Flag) +Flag CTF_FLAG; STATIC_INIT(Flag) { CTF_FLAG = NEW(Flag); } +void ctf_FlagTouch(entity this, entity toucher) { ITEM_HANDLE(Pickup, CTF_FLAG, this, toucher); } + +// flag constants // for most of these, there is just one question to be asked: WHYYYYY? + +const float FLAG_SCALE = 0.6; + +const float FLAG_THINKRATE = 0.2; +const float FLAG_TOUCHRATE = 0.5; +const float WPFE_THINKRATE = 0.5; + +const vector FLAG_DROP_OFFSET = ('0 0 32'); +const vector FLAG_CARRY_OFFSET = ('-16 0 8'); +#define FLAG_SPAWN_OFFSET ('0 0 1' * (PL_MAX_CONST.z - 13)) +const vector FLAG_WAYPOINT_OFFSET = ('0 0 64'); +const vector FLAG_FLOAT_OFFSET = ('0 0 32'); +const vector FLAG_PASS_ARC_OFFSET = ('0 0 -10'); + +const vector VEHICLE_FLAG_OFFSET = ('0 0 96'); +const float VEHICLE_FLAG_SCALE = 1.0; + +// waypoint colors +#define WPCOLOR_ENEMYFC(t) ((t) ? colormapPaletteColor(t - 1, false) * 0.75 : '1 1 1') +#define WPCOLOR_FLAGCARRIER(t) ((t) ? colormapPaletteColor(t - 1, false) * 0.75 : '1 1 1') +//#define WPCOLOR_FLAGCARRIER(t) (WP_FlagCarrier.m_color) +#define WPCOLOR_DROPPEDFLAG(t) ((t) ? ('0.25 0.25 0.25' + colormapPaletteColor(t - 1, false)) * 0.5 : '1 1 1') + +// sounds +#define snd_flag_taken noise +#define snd_flag_returned noise1 +#define snd_flag_capture noise2 +#define snd_flag_respawn noise3 +.string snd_flag_dropped; +.string snd_flag_touch; +.string snd_flag_pass; + +// score fields +.float score_assist; +.float score_capture; +.float score_drop; // note: negated +.float score_pickup; +.float score_return; +.float score_team_capture; // shouldn't be too high + +// effects +.string toucheffect; +.string passeffect; +.string capeffect; + +// list of flags on the map +entity ctf_worldflaglist; +.entity ctf_worldflagnext; +.entity ctf_staleflagnext; + +// waypoint sprites +.entity wps_helpme; +.entity wps_flagbase; +.entity wps_flagcarrier; +.entity wps_flagdropped; +.entity wps_flagreturn; +.entity wps_enemyflagcarrier; +.float wps_helpme_time; +bool wpforenemy_announced; +float wpforenemy_nextthink; + +// statuses +const int FLAG_BASE = 1; +const int FLAG_DROPPED = 2; +const int FLAG_CARRY = 3; +const int FLAG_PASSING = 4; + +const int DROP_NORMAL = 1; +const int DROP_THROW = 2; +const int DROP_PASS = 3; +const int DROP_RESET = 4; + +const int PICKUP_BASE = 1; +const int PICKUP_DROPPED = 2; + +const int CAPTURE_NORMAL = 1; +const int CAPTURE_DROPPED = 2; + +const int RETURN_TIMEOUT = 1; +const int RETURN_DROPPED = 2; +const int RETURN_DAMAGE = 3; +const int RETURN_SPEEDRUN = 4; +const int RETURN_NEEDKILL = 5; + +bool ctf_Stalemate_Customize(entity this, entity client); + +void ctf_Handle_Throw(entity player, entity receiver, float droptype); + +// flag properties +#define ctf_spawnorigin dropped_origin +bool ctf_stalemate; // indicates that a stalemate is active +float ctf_captimerecord; // record time for capturing the flag +.float ctf_pickuptime; +.float ctf_droptime; +.int ctf_status; // status of the flag (FLAG_BASE, FLAG_DROPPED, FLAG_CARRY declared globally) +.entity ctf_dropper; // don't allow spam of dropping the flag +.int max_flag_health; +.float next_take_time; +.bool ctf_flagdamaged_byworld; +int ctf_teams; +.entity enemy; // when flag is back in the base, it remembers last player who carried/touched the flag, useful to bots + +// passing/throwing properties +.float pass_distance; +.entity pass_sender; +.entity pass_target; +.float throw_antispam; +.float throw_prevtime; +.int throw_count; + +// CaptureShield: If the player is too bad to be allowed to capture, shield them from taking the flag. +.bool ctf_captureshielded; // set to 1 if the player is too bad to be allowed to capture +float ctf_captureshield_min_negscore; // punish at -20 points +float ctf_captureshield_max_ratio; // punish at most 30% of each team +float ctf_captureshield_force; // push force of the shield + +// 1 flag ctf +bool ctf_oneflag; // indicates whether or not a neutral flag has been found + +// bot player logic +const int HAVOCBOT_CTF_ROLE_NONE = 0; +const int HAVOCBOT_CTF_ROLE_DEFENSE = 2; +const int HAVOCBOT_CTF_ROLE_MIDDLE = 4; +const int HAVOCBOT_CTF_ROLE_OFFENSE = 8; +const int HAVOCBOT_CTF_ROLE_CARRIER = 16; +const int HAVOCBOT_CTF_ROLE_RETRIEVER = 32; +const int HAVOCBOT_CTF_ROLE_ESCORT = 64; + +.bool havocbot_cantfindflag; + +void havocbot_role_ctf_setrole(entity bot, int role); + +// team checking +#define CTF_SAMETEAM(a,b) ((autocvar_g_ctf_reverse || (ctf_oneflag && autocvar_g_ctf_oneflag_reverse)) ? DIFF_TEAM(a,b) : SAME_TEAM(a,b)) +#define CTF_DIFFTEAM(a,b) ((autocvar_g_ctf_reverse || (ctf_oneflag && autocvar_g_ctf_oneflag_reverse)) ? SAME_TEAM(a,b) : DIFF_TEAM(a,b)) diff --git a/qcsrc/common/gamemodes/gamemode/cts/_mod.inc b/qcsrc/common/gamemodes/gamemode/cts/_mod.inc index ab0d8a477..a48cd89dd 100644 --- a/qcsrc/common/gamemodes/gamemode/cts/_mod.inc +++ b/qcsrc/common/gamemodes/gamemode/cts/_mod.inc @@ -1,2 +1,4 @@ // generated file; do not modify -#include +#ifdef SVQC + #include +#endif diff --git a/qcsrc/common/gamemodes/gamemode/cts/_mod.qh b/qcsrc/common/gamemodes/gamemode/cts/_mod.qh index a20b5c375..d05e62987 100644 --- a/qcsrc/common/gamemodes/gamemode/cts/_mod.qh +++ b/qcsrc/common/gamemodes/gamemode/cts/_mod.qh @@ -1,2 +1,4 @@ // generated file; do not modify -#include +#ifdef SVQC + #include +#endif diff --git a/qcsrc/common/gamemodes/gamemode/cts/cts.qc b/qcsrc/common/gamemodes/gamemode/cts/sv_cts.qc similarity index 99% rename from qcsrc/common/gamemodes/gamemode/cts/cts.qc rename to qcsrc/common/gamemodes/gamemode/cts/sv_cts.qc index 619028934..3a9be2abd 100644 --- a/qcsrc/common/gamemodes/gamemode/cts/cts.qc +++ b/qcsrc/common/gamemodes/gamemode/cts/sv_cts.qc @@ -1,7 +1,5 @@ -#include "cts.qh" +#include "sv_cts.qh" -// TODO: split into sv_cts -#ifdef SVQC #include #include @@ -89,7 +87,6 @@ MUTATOR_HOOKFUNCTION(cts, PlayerPhysics) player.race_movetime_count += f; player.race_movetime = player.race_movetime_frac + player.race_movetime_count; -#ifdef SVQC if(IS_PLAYER(player)) { if (player.race_penalty) @@ -102,7 +99,6 @@ MUTATOR_HOOKFUNCTION(cts, PlayerPhysics) player.disableclientprediction = 2; } } -#endif // force kbd movement for fairness float wishspeed; @@ -432,4 +428,3 @@ void cts_Initialize() { cts_ScoreRules(); } -#endif diff --git a/qcsrc/common/gamemodes/gamemode/cts/cts.qh b/qcsrc/common/gamemodes/gamemode/cts/sv_cts.qh similarity index 95% rename from qcsrc/common/gamemodes/gamemode/cts/cts.qh rename to qcsrc/common/gamemodes/gamemode/cts/sv_cts.qh index 516e903a9..8c8453d76 100644 --- a/qcsrc/common/gamemodes/gamemode/cts/cts.qh +++ b/qcsrc/common/gamemodes/gamemode/cts/sv_cts.qh @@ -1,6 +1,5 @@ #pragma once -#ifdef SVQC #include #include @@ -23,4 +22,3 @@ REGISTER_MUTATOR(cts, false) // scores const float ST_CTS_LAPS = 1; -#endif diff --git a/qcsrc/common/gamemodes/gamemode/deathmatch/_mod.inc b/qcsrc/common/gamemodes/gamemode/deathmatch/_mod.inc index 2403aad75..ba2449386 100644 --- a/qcsrc/common/gamemodes/gamemode/deathmatch/_mod.inc +++ b/qcsrc/common/gamemodes/gamemode/deathmatch/_mod.inc @@ -1,2 +1,4 @@ // generated file; do not modify -#include +#ifdef SVQC + #include +#endif diff --git a/qcsrc/common/gamemodes/gamemode/deathmatch/_mod.qh b/qcsrc/common/gamemodes/gamemode/deathmatch/_mod.qh index 2135ec9d8..abc7db377 100644 --- a/qcsrc/common/gamemodes/gamemode/deathmatch/_mod.qh +++ b/qcsrc/common/gamemodes/gamemode/deathmatch/_mod.qh @@ -1,2 +1,4 @@ // generated file; do not modify -#include +#ifdef SVQC + #include +#endif diff --git a/qcsrc/common/gamemodes/gamemode/deathmatch/deathmatch.qc b/qcsrc/common/gamemodes/gamemode/deathmatch/sv_deathmatch.qc similarity index 59% rename from qcsrc/common/gamemodes/gamemode/deathmatch/deathmatch.qc rename to qcsrc/common/gamemodes/gamemode/deathmatch/sv_deathmatch.qc index 5cd7ca1f5..e622a1942 100644 --- a/qcsrc/common/gamemodes/gamemode/deathmatch/deathmatch.qc +++ b/qcsrc/common/gamemodes/gamemode/deathmatch/sv_deathmatch.qc @@ -1,10 +1,7 @@ -#include "deathmatch.qh" +#include "sv_deathmatch.qh" -// TODO: sv_deathmatch? -#ifdef SVQC MUTATOR_HOOKFUNCTION(dm, Scores_CountFragsRemaining) { // announce remaining frags return true; } -#endif diff --git a/qcsrc/common/gamemodes/gamemode/deathmatch/deathmatch.qh b/qcsrc/common/gamemodes/gamemode/deathmatch/sv_deathmatch.qh similarity index 85% rename from qcsrc/common/gamemodes/gamemode/deathmatch/deathmatch.qh rename to qcsrc/common/gamemodes/gamemode/deathmatch/sv_deathmatch.qh index fdae27863..c08d5f87a 100644 --- a/qcsrc/common/gamemodes/gamemode/deathmatch/deathmatch.qh +++ b/qcsrc/common/gamemodes/gamemode/deathmatch/sv_deathmatch.qh @@ -1,10 +1,8 @@ #pragma once -#ifdef SVQC #include REGISTER_MUTATOR(dm, false) { MUTATOR_STATIC(); return 0; } -#endif diff --git a/qcsrc/common/gamemodes/gamemode/domination/_mod.inc b/qcsrc/common/gamemodes/gamemode/domination/_mod.inc index 95d00b389..ff9bc11f8 100644 --- a/qcsrc/common/gamemodes/gamemode/domination/_mod.inc +++ b/qcsrc/common/gamemodes/gamemode/domination/_mod.inc @@ -1,2 +1,4 @@ // generated file; do not modify -#include +#ifdef SVQC + #include +#endif diff --git a/qcsrc/common/gamemodes/gamemode/domination/_mod.qh b/qcsrc/common/gamemodes/gamemode/domination/_mod.qh index e57c30efe..0c5e84121 100644 --- a/qcsrc/common/gamemodes/gamemode/domination/_mod.qh +++ b/qcsrc/common/gamemodes/gamemode/domination/_mod.qh @@ -1,2 +1,4 @@ // generated file; do not modify -#include +#ifdef SVQC + #include +#endif diff --git a/qcsrc/common/gamemodes/gamemode/domination/domination.qc b/qcsrc/common/gamemodes/gamemode/domination/sv_domination.qc similarity index 99% rename from qcsrc/common/gamemodes/gamemode/domination/domination.qc rename to qcsrc/common/gamemodes/gamemode/domination/sv_domination.qc index 0cea02f2f..751d23aa1 100644 --- a/qcsrc/common/gamemodes/gamemode/domination/domination.qc +++ b/qcsrc/common/gamemodes/gamemode/domination/sv_domination.qc @@ -1,7 +1,5 @@ -#include "domination.qh" +#include "sv_domination.qh" -// TODO: sv_domination -#ifdef SVQC #include bool g_domination; @@ -670,4 +668,3 @@ void dom_Initialize() g_domination = true; InitializeEntity(NULL, dom_DelayedInit, INITPRIO_GAMETYPE); } -#endif diff --git a/qcsrc/common/gamemodes/gamemode/domination/domination.qh b/qcsrc/common/gamemodes/gamemode/domination/sv_domination.qh similarity index 98% rename from qcsrc/common/gamemodes/gamemode/domination/domination.qh rename to qcsrc/common/gamemodes/gamemode/domination/sv_domination.qh index f4faf50a4..67e00082c 100644 --- a/qcsrc/common/gamemodes/gamemode/domination/domination.qh +++ b/qcsrc/common/gamemodes/gamemode/domination/sv_domination.qh @@ -1,6 +1,5 @@ #pragma once -#ifdef SVQC #include #define autocvar_g_domination_point_limit cvar("g_domination_point_limit") bool autocvar_g_domination_roundbased; @@ -51,4 +50,3 @@ void AnimateDomPoint(entity this); IntrusiveList g_dompoints; STATIC_INIT(g_dompoints) { g_dompoints = IL_NEW(); } -#endif diff --git a/qcsrc/common/gamemodes/gamemode/freezetag/_mod.inc b/qcsrc/common/gamemodes/gamemode/freezetag/_mod.inc index aff5bf9d7..4d6280035 100644 --- a/qcsrc/common/gamemodes/gamemode/freezetag/_mod.inc +++ b/qcsrc/common/gamemodes/gamemode/freezetag/_mod.inc @@ -1,2 +1,4 @@ // generated file; do not modify -#include +#ifdef SVQC + #include +#endif diff --git a/qcsrc/common/gamemodes/gamemode/freezetag/_mod.qh b/qcsrc/common/gamemodes/gamemode/freezetag/_mod.qh index 1bc21821a..785d7b813 100644 --- a/qcsrc/common/gamemodes/gamemode/freezetag/_mod.qh +++ b/qcsrc/common/gamemodes/gamemode/freezetag/_mod.qh @@ -1,2 +1,4 @@ // generated file; do not modify -#include +#ifdef SVQC + #include +#endif diff --git a/qcsrc/common/gamemodes/gamemode/freezetag/freezetag.qc b/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc similarity index 99% rename from qcsrc/common/gamemodes/gamemode/freezetag/freezetag.qc rename to qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc index 15726ada3..804b39d67 100644 --- a/qcsrc/common/gamemodes/gamemode/freezetag/freezetag.qc +++ b/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc @@ -1,7 +1,4 @@ -#include "freezetag.qh" - -// TODO: sv_freezetag -#ifdef SVQC +#include "sv_freezetag.qh" #include @@ -607,4 +604,3 @@ void freezetag_Initialize() EliminatedPlayers_Init(freezetag_isEliminated); } -#endif diff --git a/qcsrc/common/gamemodes/gamemode/freezetag/freezetag.qh b/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qh similarity index 97% rename from qcsrc/common/gamemodes/gamemode/freezetag/freezetag.qh rename to qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qh index ed38ae50a..4a3d80fd1 100644 --- a/qcsrc/common/gamemodes/gamemode/freezetag/freezetag.qh +++ b/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qh @@ -1,6 +1,5 @@ #pragma once -#ifdef SVQC #include int autocvar_g_freezetag_point_limit; int autocvar_g_freezetag_point_leadlimit; @@ -34,4 +33,3 @@ float autocvar_g_freezetag_revive_extra_size; float autocvar_g_freezetag_revive_speed; bool autocvar_g_freezetag_revive_nade; float autocvar_g_freezetag_revive_nade_health; -#endif diff --git a/qcsrc/common/gamemodes/gamemode/invasion/_mod.inc b/qcsrc/common/gamemodes/gamemode/invasion/_mod.inc index 905aa0611..a197891fe 100644 --- a/qcsrc/common/gamemodes/gamemode/invasion/_mod.inc +++ b/qcsrc/common/gamemodes/gamemode/invasion/_mod.inc @@ -1,2 +1,4 @@ // generated file; do not modify -#include +#ifdef SVQC + #include +#endif diff --git a/qcsrc/common/gamemodes/gamemode/invasion/_mod.qh b/qcsrc/common/gamemodes/gamemode/invasion/_mod.qh index d8e8d223d..f90ea9b31 100644 --- a/qcsrc/common/gamemodes/gamemode/invasion/_mod.qh +++ b/qcsrc/common/gamemodes/gamemode/invasion/_mod.qh @@ -1,2 +1,4 @@ // generated file; do not modify -#include +#ifdef SVQC + #include +#endif diff --git a/qcsrc/common/gamemodes/gamemode/invasion/invasion.qc b/qcsrc/common/gamemodes/gamemode/invasion/sv_invasion.qc similarity index 99% rename from qcsrc/common/gamemodes/gamemode/invasion/invasion.qc rename to qcsrc/common/gamemodes/gamemode/invasion/sv_invasion.qc index 00e2241c6..c9670a150 100644 --- a/qcsrc/common/gamemodes/gamemode/invasion/invasion.qc +++ b/qcsrc/common/gamemodes/gamemode/invasion/sv_invasion.qc @@ -1,7 +1,5 @@ -#include "invasion.qh" +#include "sv_invasion.qh" -// TODO: sv_invasion -#ifdef SVQC #include #include #include @@ -603,4 +601,3 @@ void invasion_Initialize() { InitializeEntity(NULL, invasion_DelayedInit, INITPRIO_GAMETYPE); } -#endif diff --git a/qcsrc/common/gamemodes/gamemode/invasion/invasion.qh b/qcsrc/common/gamemodes/gamemode/invasion/sv_invasion.qh similarity index 98% rename from qcsrc/common/gamemodes/gamemode/invasion/invasion.qh rename to qcsrc/common/gamemodes/gamemode/invasion/sv_invasion.qh index 85cd7ec09..167380eeb 100644 --- a/qcsrc/common/gamemodes/gamemode/invasion/invasion.qh +++ b/qcsrc/common/gamemodes/gamemode/invasion/sv_invasion.qh @@ -1,6 +1,5 @@ #pragma once -#ifdef SVQC #include #define autocvar_g_invasion_point_limit cvar("g_invasion_point_limit") int autocvar_g_invasion_teams; @@ -45,4 +44,3 @@ const float ST_INV_KILLS = 1; const int INV_TYPE_ROUND = 0; // round-based waves of enemies const int INV_TYPE_HUNT = 1; // clear the map of placed enemies const int INV_TYPE_STAGE = 2; // reach the end of the level -#endif diff --git a/qcsrc/common/gamemodes/gamemode/keepaway/_mod.inc b/qcsrc/common/gamemodes/gamemode/keepaway/_mod.inc index 9426d7807..420f7af78 100644 --- a/qcsrc/common/gamemodes/gamemode/keepaway/_mod.inc +++ b/qcsrc/common/gamemodes/gamemode/keepaway/_mod.inc @@ -1,2 +1,4 @@ // generated file; do not modify -#include +#ifdef SVQC + #include +#endif diff --git a/qcsrc/common/gamemodes/gamemode/keepaway/_mod.qh b/qcsrc/common/gamemodes/gamemode/keepaway/_mod.qh index 32872a2a6..145ca49f0 100644 --- a/qcsrc/common/gamemodes/gamemode/keepaway/_mod.qh +++ b/qcsrc/common/gamemodes/gamemode/keepaway/_mod.qh @@ -1,2 +1,4 @@ // generated file; do not modify -#include +#ifdef SVQC + #include +#endif diff --git a/qcsrc/common/gamemodes/gamemode/keepaway/keepaway.qc b/qcsrc/common/gamemodes/gamemode/keepaway/sv_keepaway.qc similarity index 99% rename from qcsrc/common/gamemodes/gamemode/keepaway/keepaway.qc rename to qcsrc/common/gamemodes/gamemode/keepaway/sv_keepaway.qc index c8bfbf25a..133050b00 100644 --- a/qcsrc/common/gamemodes/gamemode/keepaway/keepaway.qc +++ b/qcsrc/common/gamemodes/gamemode/keepaway/sv_keepaway.qc @@ -1,7 +1,5 @@ -#include "keepaway.qh" +#include "sv_keepaway.qh" -// TODO: keepaway -#ifdef SVQC #include .entity ballcarried; @@ -472,4 +470,3 @@ void ka_Initialize() // run at the start of a match, initiates game mode { ka_SpawnBall(); } -#endif diff --git a/qcsrc/common/gamemodes/gamemode/keepaway/keepaway.qh b/qcsrc/common/gamemodes/gamemode/keepaway/sv_keepaway.qh similarity index 96% rename from qcsrc/common/gamemodes/gamemode/keepaway/keepaway.qh rename to qcsrc/common/gamemodes/gamemode/keepaway/sv_keepaway.qh index a4615c146..83208bf37 100644 --- a/qcsrc/common/gamemodes/gamemode/keepaway/keepaway.qh +++ b/qcsrc/common/gamemodes/gamemode/keepaway/sv_keepaway.qh @@ -1,6 +1,5 @@ #pragma once -#ifdef SVQC #include #include void ka_Initialize(); @@ -28,4 +27,3 @@ void(entity this) havocbot_role_ka_carrier; void(entity this) havocbot_role_ka_collector; void ka_DropEvent(entity plyr); -#endif diff --git a/qcsrc/common/gamemodes/gamemode/keyhunt/_mod.inc b/qcsrc/common/gamemodes/gamemode/keyhunt/_mod.inc index 3861dea00..4f44840c4 100644 --- a/qcsrc/common/gamemodes/gamemode/keyhunt/_mod.inc +++ b/qcsrc/common/gamemodes/gamemode/keyhunt/_mod.inc @@ -1,2 +1,4 @@ // generated file; do not modify -#include +#ifdef SVQC + #include +#endif diff --git a/qcsrc/common/gamemodes/gamemode/keyhunt/_mod.qh b/qcsrc/common/gamemodes/gamemode/keyhunt/_mod.qh index cd796c7ef..e4143fc84 100644 --- a/qcsrc/common/gamemodes/gamemode/keyhunt/_mod.qh +++ b/qcsrc/common/gamemodes/gamemode/keyhunt/_mod.qh @@ -1,2 +1,4 @@ // generated file; do not modify -#include +#ifdef SVQC + #include +#endif diff --git a/qcsrc/common/gamemodes/gamemode/keyhunt/keyhunt.qc b/qcsrc/common/gamemodes/gamemode/keyhunt/sv_keyhunt.qc similarity index 99% rename from qcsrc/common/gamemodes/gamemode/keyhunt/keyhunt.qc rename to qcsrc/common/gamemodes/gamemode/keyhunt/sv_keyhunt.qc index 5e0d3fcbb..c73b4952a 100644 --- a/qcsrc/common/gamemodes/gamemode/keyhunt/keyhunt.qc +++ b/qcsrc/common/gamemodes/gamemode/keyhunt/sv_keyhunt.qc @@ -1,7 +1,5 @@ -#include "keyhunt.qh" +#include "sv_keyhunt.qh" -// TODO: sv_keyhunt -#ifdef SVQC float autocvar_g_balance_keyhunt_damageforcescale; float autocvar_g_balance_keyhunt_delay_collect; float autocvar_g_balance_keyhunt_delay_damage_return; @@ -1322,4 +1320,3 @@ MUTATOR_HOOKFUNCTION(kh, reset_map_global) { kh_WaitForPlayers(); // takes care of killing the "missing teams" message } -#endif diff --git a/qcsrc/common/gamemodes/gamemode/keyhunt/keyhunt.qh b/qcsrc/common/gamemodes/gamemode/keyhunt/sv_keyhunt.qh similarity index 97% rename from qcsrc/common/gamemodes/gamemode/keyhunt/keyhunt.qh rename to qcsrc/common/gamemodes/gamemode/keyhunt/sv_keyhunt.qh index a086ee689..345a3d166 100644 --- a/qcsrc/common/gamemodes/gamemode/keyhunt/keyhunt.qh +++ b/qcsrc/common/gamemodes/gamemode/keyhunt/sv_keyhunt.qh @@ -1,6 +1,5 @@ #pragma once -#ifdef SVQC #include #define autocvar_g_keyhunt_point_limit cvar("g_keyhunt_point_limit") int autocvar_g_keyhunt_point_leadlimit; @@ -33,4 +32,3 @@ bool kh_tracking_enabled; USING(kh_Think_t, void()); void kh_StartRound(); void kh_Controller_SetThink(float t, kh_Think_t func); -#endif diff --git a/qcsrc/common/gamemodes/gamemode/lms/_mod.inc b/qcsrc/common/gamemodes/gamemode/lms/_mod.inc index 43bb76d7f..fcf63d7cc 100644 --- a/qcsrc/common/gamemodes/gamemode/lms/_mod.inc +++ b/qcsrc/common/gamemodes/gamemode/lms/_mod.inc @@ -1,2 +1,4 @@ // generated file; do not modify -#include +#ifdef SVQC + #include +#endif diff --git a/qcsrc/common/gamemodes/gamemode/lms/_mod.qh b/qcsrc/common/gamemodes/gamemode/lms/_mod.qh index 5e780bb67..51c1ee15f 100644 --- a/qcsrc/common/gamemodes/gamemode/lms/_mod.qh +++ b/qcsrc/common/gamemodes/gamemode/lms/_mod.qh @@ -1,2 +1,4 @@ // generated file; do not modify -#include +#ifdef SVQC + #include +#endif diff --git a/qcsrc/common/gamemodes/gamemode/lms/lms.qc b/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc similarity index 99% rename from qcsrc/common/gamemodes/gamemode/lms/lms.qc rename to qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc index b6bfb4ef4..ffbecf1b3 100644 --- a/qcsrc/common/gamemodes/gamemode/lms/lms.qc +++ b/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc @@ -1,6 +1,5 @@ -#include "lms.qh" +#include "sv_lms.qh" -#ifdef SVQC #include #include #include @@ -435,4 +434,3 @@ void lms_Initialize() { lms_lowest_lives = 9999; } -#endif diff --git a/qcsrc/common/gamemodes/gamemode/lms/lms.qh b/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qh similarity index 97% rename from qcsrc/common/gamemodes/gamemode/lms/lms.qh rename to qcsrc/common/gamemodes/gamemode/lms/sv_lms.qh index 288922049..256620a45 100644 --- a/qcsrc/common/gamemodes/gamemode/lms/lms.qh +++ b/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qh @@ -1,6 +1,5 @@ #pragma once -#ifdef SVQC #include #include .float lms_spectate_warning; @@ -28,4 +27,3 @@ REGISTER_MUTATOR(lms, false) // lives related defs float lms_lowest_lives; float LMS_NewPlayerLives(); -#endif diff --git a/qcsrc/common/gamemodes/gamemode/race/_mod.inc b/qcsrc/common/gamemodes/gamemode/race/_mod.inc index 73f34a583..5ed2c9598 100644 --- a/qcsrc/common/gamemodes/gamemode/race/_mod.inc +++ b/qcsrc/common/gamemodes/gamemode/race/_mod.inc @@ -1,2 +1,4 @@ // generated file; do not modify -#include +#ifdef SVQC + #include +#endif diff --git a/qcsrc/common/gamemodes/gamemode/race/_mod.qh b/qcsrc/common/gamemodes/gamemode/race/_mod.qh index 1158df561..1e76e7af3 100644 --- a/qcsrc/common/gamemodes/gamemode/race/_mod.qh +++ b/qcsrc/common/gamemodes/gamemode/race/_mod.qh @@ -1,2 +1,4 @@ // generated file; do not modify -#include +#ifdef SVQC + #include +#endif diff --git a/qcsrc/common/gamemodes/gamemode/race/race.qc b/qcsrc/common/gamemodes/gamemode/race/sv_race.qc similarity index 99% rename from qcsrc/common/gamemodes/gamemode/race/race.qc rename to qcsrc/common/gamemodes/gamemode/race/sv_race.qc index aaf83cb39..31309f285 100644 --- a/qcsrc/common/gamemodes/gamemode/race/race.qc +++ b/qcsrc/common/gamemodes/gamemode/race/sv_race.qc @@ -1,7 +1,5 @@ -#include "race.qh" +#include "sv_race.qh" -// TODO: sv_race -#ifdef SVQC #include #define autocvar_g_race_laps_limit cvar("g_race_laps_limit") @@ -490,4 +488,3 @@ void rc_SetLimits() GameRules_limit_time(timelimit_override); GameRules_limit_time_qualifying(qualifying_override); } -#endif diff --git a/qcsrc/common/gamemodes/gamemode/race/race.qh b/qcsrc/common/gamemodes/gamemode/race/sv_race.qh similarity index 92% rename from qcsrc/common/gamemodes/gamemode/race/race.qh rename to qcsrc/common/gamemodes/gamemode/race/sv_race.qh index ad966af72..9928b8cb7 100644 --- a/qcsrc/common/gamemodes/gamemode/race/race.qh +++ b/qcsrc/common/gamemodes/gamemode/race/sv_race.qh @@ -1,6 +1,5 @@ #pragma once -#ifdef SVQC #include void rc_SetLimits(); void race_Initialize(); @@ -16,4 +15,3 @@ REGISTER_MUTATOR(rc, false) } return 0; } -#endif diff --git a/qcsrc/common/gamemodes/gamemode/tdm/_mod.inc b/qcsrc/common/gamemodes/gamemode/tdm/_mod.inc index ef7137a00..5c0e949a8 100644 --- a/qcsrc/common/gamemodes/gamemode/tdm/_mod.inc +++ b/qcsrc/common/gamemodes/gamemode/tdm/_mod.inc @@ -1,2 +1,4 @@ // generated file; do not modify -#include +#ifdef SVQC + #include +#endif diff --git a/qcsrc/common/gamemodes/gamemode/tdm/_mod.qh b/qcsrc/common/gamemodes/gamemode/tdm/_mod.qh index f1965c109..5be8ea6e6 100644 --- a/qcsrc/common/gamemodes/gamemode/tdm/_mod.qh +++ b/qcsrc/common/gamemodes/gamemode/tdm/_mod.qh @@ -1,2 +1,4 @@ // generated file; do not modify -#include +#ifdef SVQC + #include +#endif diff --git a/qcsrc/common/gamemodes/gamemode/tdm/tdm.qc b/qcsrc/common/gamemodes/gamemode/tdm/sv_tdm.qc similarity index 97% rename from qcsrc/common/gamemodes/gamemode/tdm/tdm.qc rename to qcsrc/common/gamemodes/gamemode/tdm/sv_tdm.qc index cf328902b..43a993844 100644 --- a/qcsrc/common/gamemodes/gamemode/tdm/tdm.qc +++ b/qcsrc/common/gamemodes/gamemode/tdm/sv_tdm.qc @@ -1,8 +1,6 @@ -#include "tdm.qh" +#include "sv_tdm.qh" -// TODO: sv_tdm // TODO? rename to teamdeathmatch -#ifdef SVQC int autocvar_g_tdm_teams; int autocvar_g_tdm_teams_override; @@ -63,4 +61,3 @@ MUTATOR_HOOKFUNCTION(tdm, Scores_CountFragsRemaining) // announce remaining frags return true; } -#endif diff --git a/qcsrc/common/gamemodes/gamemode/tdm/tdm.qh b/qcsrc/common/gamemodes/gamemode/tdm/sv_tdm.qh similarity index 96% rename from qcsrc/common/gamemodes/gamemode/tdm/tdm.qh rename to qcsrc/common/gamemodes/gamemode/tdm/sv_tdm.qh index 1c8674a01..adc6a3d6c 100644 --- a/qcsrc/common/gamemodes/gamemode/tdm/tdm.qh +++ b/qcsrc/common/gamemodes/gamemode/tdm/sv_tdm.qh @@ -1,6 +1,5 @@ #pragma once -#ifdef SVQC #include int autocvar_g_tdm_point_limit; int autocvar_g_tdm_point_leadlimit; @@ -21,4 +20,3 @@ REGISTER_MUTATOR(tdm, false) } return 0; } -#endif -- 2.39.2