]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
stop zoom when dying
authorRudolf Polzer <divverent@alientrap.org>
Sat, 25 Dec 2010 18:57:59 +0000 (19:57 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Sat, 25 Dec 2010 18:57:59 +0000 (19:57 +0100)
qcsrc/server/cl_player.qc

index 342cbbc3d69e4a8e6e9a011c246e14d892f24a09..0dc1815dc4d62d76b4de5a6a262ddf610a6c71f7 100644 (file)
@@ -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;
                }
        }