]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cl_player.qc
Minstanex and Nex
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cl_player.qc
index 0dc1815dc4d62d76b4de5a6a262ddf610a6c71f7..6853031f9217069da21d0bbeb077e8924fcbe39e 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)
@@ -371,7 +374,7 @@ void PlayerCorpseDamage (entity inflictor, entity attacker, float damage, float
        self.dmg_take = self.dmg_take + take;//max(take - 10, 0);
        self.dmg_inflictor = inflictor;
 
-       if (self.health <= -100 && self.modelindex != 0)
+       if (self.health <= -150 && self.modelindex != 0)
        {
                // don't use any animations as a gib
                self.frame = 0;
@@ -387,13 +390,16 @@ 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)
 {
        local float take, save, waves, sdelay, dh, da, j;
        vector v;
        float valid_damage_for_weaponstats;
+       float excess;
+
+       if((g_arena && numspawned < 2) || (g_ca && ca_players < required_ca_players) && !inWarmupStage)
+               return;
 
        dh = max(self.health, 0);
        da = max(self.armorvalue, 0);
@@ -436,9 +442,6 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
        else
                Violence_GibSplash_At(hitloc, force, 2, bound(0, damage, 200) / 16, self, attacker);
 
-       if((g_arena && numspawned < 2) || (g_ca && ca_players < required_ca_players) && !inWarmupStage)
-               return;
-
        if (!g_minstagib)
        {
                v = healtharmor_applydamage(self.armorvalue, autocvar_g_balance_armor_blockpercent, damage);
@@ -460,6 +463,7 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
        MUTATOR_CALLHOOK(PlayerDamage_SplitHealthArmor);
        take = bound(0, damage_take, self.health);
        save = bound(0, damage_save, self.armorvalue);
+       excess = max(0, damage - take - save);
 
        if(sound_allowed(MSG_BROADCAST, attacker))
        {
@@ -643,8 +647,6 @@ 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
-               WaypointSprite_PlayerDead();
 
                if(clienttype(self) == CLIENTTYPE_REAL)
                {
@@ -666,6 +668,10 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
                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;
@@ -717,7 +723,7 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
                // set damage function to corpse damage
                self.event_damage = PlayerCorpseDamage;
                // call the corpse damage function just in case it wants to gib
-               self.event_damage(inflictor, attacker, 0, deathtype, hitloc, force);
+               self.event_damage(inflictor, attacker, excess, deathtype, hitloc, force);
                // set up to fade out later
                SUB_SetFade (self, time + 6 + random (), 1);