]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cl_client.qc
Remove selfparam from triggers
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cl_client.qc
index e9fbdbdc865db312736cdf14eaf945402ed81946..fe0c3a547fa776d04e5d13a42fd9ee11a2c69d38 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;
@@ -1162,7 +1162,7 @@ void ClientConnect()
                sv_notice_join(this);
 
        FOREACH_ENTITY_FLOAT(init_for_player_needed, true, {
-               WITHSELF(it, it.init_for_player(it));
+               it.init_for_player(it, this);
        });
 
        MUTATOR_CALLHOOK(ClientConnect, this);
@@ -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;
                        }
@@ -2317,7 +2321,7 @@ void PlayerPreThink ()
                if (frametime) player_anim();
 
                // secret status
-               secrets_setstatus();
+               secrets_setstatus(this);
 
                // monsters status
                monsters_setstatus(this);
@@ -2466,7 +2470,7 @@ void PlayerPostThink ()
                WaypointSprite_UpdateHealth(this.waypointsprite_attachedforcarrier, '1 0 0' * v);
     }
 
-       playerdemo_write();
+       playerdemo_write(this);
 
        CSQCMODEL_AUTOUPDATE(this);
 }