X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fgamemodes%2Fgamemode%2Fctf%2Fsv_ctf.qh;h=cd503721622c97dd5ced19bd8940a5270d8b40b9;hb=1d2616a91090d900f45d42580661057b4e22ae7d;hp=58954905c2106af96bccee9c7c201724e1f846f9;hpb=ad464bb5417768682f9989dd025871d14a438e68;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qh b/qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qh index 58954905c..cd5037216 100644 --- a/qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qh +++ b/qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qh @@ -6,6 +6,11 @@ #include #include +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; void ctf_Initialize(); int autocvar_captureleadlimit_override; @@ -31,12 +36,6 @@ 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? @@ -137,6 +136,7 @@ bool ctf_stalemate; // indicates that a stalemate is active float ctf_captimerecord; // record time for capturing the flag .float ctf_pickuptime; .float ctf_droptime; +.float ctf_landtime; .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 .float next_take_time; @@ -177,3 +177,5 @@ 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)) +#define CTF_IS_NEAR(player, it, extra_size) \ + boxesoverlap(player.absmin - extra_size, player.absmax + extra_size, it.absmin, it.absmax)