]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cl_client.qc
Merge branch 'terencehill/respawn_timer_fix' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cl_client.qc
index e9fbdbdc865db312736cdf14eaf945402ed81946..ad9a1ec542cc085844f77e1905f337da70f29a59 100644 (file)
@@ -619,7 +619,7 @@ void PutClientInServer()
 
                // reset fields the weapons may use
                FOREACH(Weapons, true, LAMBDA(
-                       it.wr_resetplayer(it);
+                       it.wr_resetplayer(it, this);
                        // reload all reloadable weapons
                        if (it.spawnflags & WEP_FLAG_RELOADABLE) {
                                this.weapon_load[it.m_id] = it.reloading_ammo;
@@ -2064,7 +2064,6 @@ Called every frame for each client before the physics are run
 =============
 */
 .float usekeypressed;
-void() nexball_setstatus;
 .float last_vehiclecheck;
 .int items_added;
 void PlayerPreThink ()
@@ -2220,7 +2219,7 @@ void PlayerPreThink ()
                                bool button_pressed = (PHYS_INPUT_BUTTON_ATCK(this) || PHYS_INPUT_BUTTON_JUMP(this) || PHYS_INPUT_BUTTON_ATCK2(this) || PHYS_INPUT_BUTTON_HOOK(this) || PHYS_INPUT_BUTTON_USE(this));
 
                                if (this.deadflag == DEAD_DYING) {
-                                       if ((this.respawn_flags & RESPAWN_FORCE) && !autocvar_g_respawn_delay_max) {
+                                       if ((this.respawn_flags & RESPAWN_FORCE) && !(this.respawn_time < this.respawn_time_max)) {
                                                this.deadflag = DEAD_RESPAWNING;
                                        } else if (!button_pressed) {
                                                this.deadflag = DEAD_DEAD;
@@ -2247,8 +2246,13 @@ void PlayerPreThink ()
 
                                if (this.respawn_flags & RESPAWN_SILENT)
                                        STAT(RESPAWN_TIME, this) = 0;
-                               else if ((this.respawn_flags & RESPAWN_FORCE) && autocvar_g_respawn_delay_max)
-                                       STAT(RESPAWN_TIME, this) = this.respawn_time_max;
+                               else if ((this.respawn_flags & RESPAWN_FORCE) && this.respawn_time < 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;
                        }