]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
use last frame time instead of a counter for respawn delay
authorJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Sat, 10 Jun 2023 04:35:02 +0000 (06:35 +0200)
committerJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Sat, 10 Jun 2023 04:35:02 +0000 (06:35 +0200)
qcsrc/server/client.qc

index 609f309d60cd7798a1f4394a85816c423bfec4bf..2bbaf2490c92bc85c4f471a2562cf09982daa229 100644 (file)
@@ -1439,6 +1439,7 @@ void calculate_player_respawn_time(entity this)
        else if (c == 13) this.colormod = '0.10 0.10 1.73';
        else this.colormod = '1 1 1';
 }*/
+
 void delay_respawn(entity this);
 void respawn(entity this)
 {
@@ -1469,7 +1470,7 @@ void respawn(entity this)
        this.effects |= EF_NODRAW; // prevent another CopyBody
        entity e = spawn();
        e.enemy = this;
-       e.count = 0;
+       e.count = time;
        setthink(e, delay_respawn);
        e.nextthink = time;
 }
@@ -1477,10 +1478,9 @@ void respawn(entity this)
 // prevent darkplaces from interpolating the respawn angle by delaying respawn by one frame
 void delay_respawn(entity this)
 {
-       if(!this.count)
+       if(this.count <= time)
        {
                this.nextthink = time;
-               ++this.count;
                return;
        }