]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix speed award not updated when the timelimit is reached
authorterencehill <piuntn@gmail.com>
Fri, 12 Feb 2021 17:26:15 +0000 (18:26 +0100)
committerterencehill <piuntn@gmail.com>
Fri, 12 Feb 2021 17:26:15 +0000 (18:26 +0100)
qcsrc/common/gamemodes/gamemode/cts/sv_cts.qc
qcsrc/common/gamemodes/gamemode/race/sv_race.qc
qcsrc/server/client.qc

index 144788917415c2557d8fd5f5da7a81e3d803fb7b..bca0d1077dd31590472242102fd478b394265c06 100644 (file)
@@ -302,7 +302,7 @@ MUTATOR_HOOKFUNCTION(cts, GetPressedKeys)
                        speedaward_uid = player.crypto_idfp;
                        speedaward_lastupdate = time;
                }
-               if (speedaward_speed > speedaward_lastsent && time - speedaward_lastupdate > 1)
+               if (speedaward_speed > speedaward_lastsent && (time - speedaward_lastupdate > 1 || intermission_running))
                {
                        string rr = CTS_RECORD;
                        race_send_speedaward(MSG_ALL);
index a69a435227785f7172f65558155049abaddbbc4e..8148dda2d39f6964a503a3bc8229a8d317673fc6 100644 (file)
@@ -348,7 +348,7 @@ MUTATOR_HOOKFUNCTION(rc, GetPressedKeys)
                        speedaward_uid = player.crypto_idfp;
                        speedaward_lastupdate = time;
                }
-               if (speedaward_speed > speedaward_lastsent && time - speedaward_lastupdate > 1)
+               if (speedaward_speed > speedaward_lastsent && (time - speedaward_lastupdate > 1 || intermission_running))
                {
                        string rr = RACE_RECORD;
                        race_send_speedaward(MSG_ALL);
index 0777297a22021deaec89a27152ae96b2de6367c9..d8154ee84bf88409cb7bcddf0b5b2b9e3f022cf4 100644 (file)
@@ -1707,6 +1707,13 @@ void SetZoomState(entity this, float newzoom)
 void GetPressedKeys(entity this)
 {
        MUTATOR_CALLHOOK(GetPressedKeys, this);
+       if (game_stopped)
+       {
+               CS(this).pressedkeys = 0;
+               STAT(PRESSED_KEYS, this) = 0;
+               return;
+       }
+
        int keys = STAT(PRESSED_KEYS, this);
        keys = BITSET(keys, KEY_FORWARD,        CS(this).movement.x > 0);
        keys = BITSET(keys, KEY_BACKWARD,       CS(this).movement.x < 0);
@@ -2761,12 +2768,12 @@ void PlayerPostThink (entity this)
                DrownPlayer(this);
                UpdateChatBubble(this);
                if (CS(this).impulse) ImpulseCommands(this);
+               GetPressedKeys(this);
                if (game_stopped)
                {
                        CSQCMODEL_AUTOUPDATE(this);
                        return;
                }
-               GetPressedKeys(this);
        }
        else if (IS_OBSERVER(this) && STAT(PRESSED_KEYS, this))
        {