From df301cd57545d6d85cca1b85dad902e2dcdb05b4 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 18 Jul 2016 19:20:10 +1000 Subject: [PATCH] Implement stalemate condition on the client --- qcsrc/client/hud/panel/modicons.qc | 3 +++ qcsrc/server/mutators/mutator/gamemode_ctf.qc | 5 ++++- qcsrc/server/mutators/mutator/gamemode_ctf.qh | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/qcsrc/client/hud/panel/modicons.qc b/qcsrc/client/hud/panel/modicons.qc index 54c835831..b869f9619 100644 --- a/qcsrc/client/hud/panel/modicons.qc +++ b/qcsrc/client/hud/panel/modicons.qc @@ -117,6 +117,7 @@ void HUD_Mod_CTF(vector pos, vector mySize) int redflag, blueflag, yellowflag, pinkflag, neutralflag; // current status float redflag_statuschange_elapsedtime = 0, blueflag_statuschange_elapsedtime = 0, yellowflag_statuschange_elapsedtime = 0, pinkflag_statuschange_elapsedtime = 0, neutralflag_statuschange_elapsedtime = 0; // time since the status changed bool ctf_oneflag; // one-flag CTF mode enabled/disabled + bool ctf_stalemate; // currently in stalemate int stat_items = STAT(CTF_FLAGSTATUS); float fs, fs2, fs3, size1, size2; vector e1, e2; @@ -129,6 +130,8 @@ void HUD_Mod_CTF(vector pos, vector mySize) ctf_oneflag = (stat_items & CTF_FLAG_NEUTRAL); + ctf_stalemate = (stat_items & CTF_STALEMATE); + mod_active = (redflag || blueflag || yellowflag || pinkflag || neutralflag || (stat_items & CTF_SHIELDED)); if (autocvar__hud_configure) { diff --git a/qcsrc/server/mutators/mutator/gamemode_ctf.qc b/qcsrc/server/mutators/mutator/gamemode_ctf.qc index e5e7a7baf..948305d4b 100644 --- a/qcsrc/server/mutators/mutator/gamemode_ctf.qc +++ b/qcsrc/server/mutators/mutator/gamemode_ctf.qc @@ -1987,7 +1987,7 @@ MUTATOR_HOOKFUNCTION(ctf, PlayerPreThink) | CTF_YELLOW_FLAG_CARRYING | CTF_YELLOW_FLAG_TAKEN | CTF_YELLOW_FLAG_LOST | CTF_PINK_FLAG_CARRYING | CTF_PINK_FLAG_TAKEN | CTF_PINK_FLAG_LOST | CTF_NEUTRAL_FLAG_CARRYING | CTF_NEUTRAL_FLAG_TAKEN | CTF_NEUTRAL_FLAG_LOST - | CTF_FLAG_NEUTRAL | CTF_SHIELDED); + | CTF_FLAG_NEUTRAL | CTF_SHIELDED | CTF_STALEMATE); // scan through all the flags and notify the client about them for(entity flag = ctf_worldflaglist; flag; flag = flag.ctf_worldflagnext) @@ -2021,6 +2021,9 @@ MUTATOR_HOOKFUNCTION(ctf, PlayerPreThink) if(player.ctf_captureshielded) player.ctf_flagstatus |= CTF_SHIELDED; + if(ctf_stalemate) + player.ctf_flagstatus |= CTF_STALEMATE; + // update the health of the flag carrier waypointsprite if(player.wps_flagcarrier) WaypointSprite_UpdateHealth(player.wps_flagcarrier, '1 0 0' * healtharmor_maxdamage(player.health, player.armorvalue, autocvar_g_balance_armor_blockpercent, DEATH_WEAPON.m_id)); diff --git a/qcsrc/server/mutators/mutator/gamemode_ctf.qh b/qcsrc/server/mutators/mutator/gamemode_ctf.qh index 45de46971..45796f2b2 100644 --- a/qcsrc/server/mutators/mutator/gamemode_ctf.qh +++ b/qcsrc/server/mutators/mutator/gamemode_ctf.qh @@ -171,3 +171,4 @@ const int CTF_NEUTRAL_FLAG_LOST = 512; const int CTF_NEUTRAL_FLAG_CARRYING = 768; const int CTF_FLAG_NEUTRAL = 2048; const int CTF_SHIELDED = 4096; +const int CTF_STALEMATE = 8192; -- 2.39.2