]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cl_client.qc
Improve respawn timer when max respawn delay is higher than respawn delay
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cl_client.qc
index 208f53723d95925f06c0efea3b393b56f258b2b1..9c19574f2bbdc8e30d830fd1242772df9345d3af 100644 (file)
@@ -2250,7 +2250,12 @@ void PlayerPreThink ()
                                if (this.respawn_flags & RESPAWN_SILENT)
                                        STAT(RESPAWN_TIME, this) = 0;
                                else if ((this.respawn_flags & RESPAWN_FORCE) && this.respawn_time < this.respawn_time_max)
-                                       STAT(RESPAWN_TIME, this) = this.respawn_time_max;
+                               {
+                                       if (time < this.respawn_time)
+                                               STAT(RESPAWN_TIME, this) = this.respawn_time;
+                                       else if (this.deadflag != DEAD_RESPAWNING)
+                                               STAT(RESPAWN_TIME, this) = -this.respawn_time_max;
+                               }
                                else
                                        STAT(RESPAWN_TIME, this) = this.respawn_time;
                        }