Reset pressed keys when switching spectated player
authorterencehill <piuntn@gmail.com>
Thu, 13 Feb 2020 19:33:46 +0000 (20:33 +0100)
committerterencehill <piuntn@gmail.com>
Thu, 13 Feb 2020 19:33:46 +0000 (20:33 +0100)
qcsrc/server/client.qc

index 5d536f8..b06f163 100644 (file)
@@ -1781,6 +1781,11 @@ void SetSpectatee_status(entity this, int spectatee_num)
 
        if (CS(this).spectatee_status != oldspectatee_status)
        {
+               if (STAT(PRESSED_KEYS, this))
+               {
+                       CS(this).pressedkeys = 0;
+                       STAT(PRESSED_KEYS, this) = 0;
+               }
                ClientData_Touch(this);
                if (g_race || g_cts) race_InitSpectator();
        }