]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Implement stalemate condition on the client
authorMario <mario@smbclan.net>
Mon, 18 Jul 2016 09:20:10 +0000 (19:20 +1000)
committerMario <mario@smbclan.net>
Mon, 18 Jul 2016 09:20:10 +0000 (19:20 +1000)
qcsrc/client/hud/panel/modicons.qc
qcsrc/server/mutators/mutator/gamemode_ctf.qc
qcsrc/server/mutators/mutator/gamemode_ctf.qh

index 54c835831dec0b27510d9d41953fd2ac8c265955..b869f96194534954de800f66802e31917832e309 100644 (file)
@@ -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) {
index e5e7a7baf5aa2b7411485345208074fe859dffa6..948305d4beb40186fc9dbbf5ae1f6dc5959edfdf 100644 (file)
@@ -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));
index 45de46971f1c1efb005c43dd6a25ca400de8bc51..45796f2b234243b7f233fa5f3a801c900fc89fed 100644 (file)
@@ -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;