From bda2837ce9e0d34d57423a60f98fe5235ff79c4f Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Sat, 25 Dec 2010 19:57:59 +0100 Subject: [PATCH] stop zoom when dying --- qcsrc/server/cl_player.qc | 56 ++++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/qcsrc/server/cl_player.qc b/qcsrc/server/cl_player.qc index 342cbbc3d..0dc1815dc 100644 --- a/qcsrc/server/cl_player.qc +++ b/qcsrc/server/cl_player.qc @@ -631,9 +631,6 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht frag_target = self; MUTATOR_CALLHOOK(PlayerDies); - if(g_freezetag) - return; - if(self.flagcarried) { if(attacker.classname != "player" && attacker.classname != "gib") @@ -648,6 +645,27 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht Portal_ClearAllLater(self); // clear waypoints WaypointSprite_PlayerDead(); + + if(clienttype(self) == CLIENTTYPE_REAL) + { + stuffcmd(self, "-zoom\n"); + self.fixangle = TRUE; + //msg_entity = self; + //WriteByte (MSG_ONE, SVC_SETANGLE); + //WriteAngle (MSG_ONE, self.v_angle_x); + //WriteAngle (MSG_ONE, self.v_angle_y); + //WriteAngle (MSG_ONE, 80); + } + + if(defer_ClientKill_Now_TeamChange) // TODO does this work with FreezeTag? + ClientKill_Now_TeamChange(); + + if(g_arena) + Spawnqueue_Unmark(self); + + if(g_freezetag) + return; + // make the corpse upright (not tilted) self.angles_x = 0; self.angles_z = 0; @@ -669,12 +687,12 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht waves = 0; sdelay = cvar(strcat("g_", GetGametype(), "_respawn_delay")); if(!sdelay) - { - if(g_cts) - sdelay = 0; // no respawn delay in CTS - else - sdelay = autocvar_g_respawn_delay; - } + { + if(g_cts) + sdelay = 0; // no respawn delay in CTS + else + sdelay = autocvar_g_respawn_delay; + } waves = cvar(strcat("g_", GetGametype(), "_respawn_waves")); if(!waves) waves = autocvar_g_respawn_waves; @@ -703,31 +721,15 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht // set up to fade out later SUB_SetFade (self, time + 6 + random (), 1); - if(clienttype(self) == CLIENTTYPE_REAL) - { - self.fixangle = TRUE; - //msg_entity = self; - //WriteByte (MSG_ONE, SVC_SETANGLE); - //WriteAngle (MSG_ONE, self.v_angle_x); - //WriteAngle (MSG_ONE, self.v_angle_y); - //WriteAngle (MSG_ONE, 80); - } - - if(g_arena) - Spawnqueue_Unmark(self); - - if(defer_ClientKill_Now_TeamChange) - ClientKill_Now_TeamChange(); - if(sv_gentle > 0 || autocvar_ekg) { // remove corpse PlayerCorpseDamage (inflictor, attacker, 100.0, deathtype, hitloc, force); } // reset fields the weapons may use just in case - for (j = WEP_FIRST; j <= WEP_LAST; ++j) + for (j = WEP_FIRST; j <= WEP_LAST; ++j) { - weapon_action(j, WR_RESETPLAYER); + weapon_action(j, WR_RESETPLAYER); ATTACK_FINISHED_FOR(self, j) = 0; } } -- 2.39.2