]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cl_player.qc
fix some coloring bugs
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cl_player.qc
index 342cbbc3d69e4a8e6e9a011c246e14d892f24a09..ca0b2d4a16f0753e9e7529d7d7f4268a3b277b53 100644 (file)
@@ -325,11 +325,14 @@ void SpawnThrownWeapon (vector org, float w)
                {
                        if(self.weapons & W_WeaponBit(j))
                                if(W_IsWeaponThrowable(j))
-                                       W_ThrowNewWeapon(self, j, FALSE, self.origin, randomvec() * 175 + '0 0 325');
+                                       W_ThrowNewWeapon(self, j, FALSE, org, randomvec() * 175 + '0 0 325');
                }
        }
        else
-               W_ThrowWeapon(randomvec() * 125 + '0 0 200', org - self.origin, FALSE);
+       {
+               if(W_IsWeaponThrowable(self.weapon))
+                       W_ThrowNewWeapon(self, self.weapon, FALSE, org, randomvec() * 125 + '0 0 200');
+       }
 }
 
 void PlayerCorpseDamage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
@@ -387,7 +390,6 @@ void PlayerCorpseDamage (entity inflictor, entity attacker, float damage, float
 
 void ClientKill_Now_TeamChange();
 void freezetag_CheckWinner();
-void freezetag_Unfreeze();
 
 void PlayerDamage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
 {
@@ -631,9 +633,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")
@@ -646,8 +645,31 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
                if(self.ballcarried && g_nexball)
                        DropBall(self.ballcarried, self.origin, self.velocity);
                Portal_ClearAllLater(self);
-               // clear waypoints
+
+               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;
+
+               // when we get here, player actually dies
+               // clear waypoints (do this AFTER FreezeTag)
                WaypointSprite_PlayerDead();
+
                // make the corpse upright (not tilted)
                self.angles_x = 0;
                self.angles_z = 0;
@@ -669,12 +691,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 +725,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;
                }
        }