]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cl_player.qc
Merge remote branch 'refs/remotes/origin/fruitiex/racefixes'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cl_player.qc
index c5717f592c86e81eaa6c48bb8b6a1b56be66680e..d890f5d591ad49bc4ef21d0a9a2456704f5a5752 100644 (file)
@@ -111,6 +111,7 @@ void CopyBody(float keepvelocity)
        self.enemy = oldself;
        self.lip = oldself.lip;
        self.colormap = oldself.colormap;
+       self.glowmod = oldself.glowmod;
        self.iscreature = oldself.iscreature;
        self.angles = oldself.angles;
        self.avelocity = oldself.avelocity;
@@ -142,6 +143,7 @@ void CopyBody(float keepvelocity)
        self.movetype = oldself.movetype;
        self.nextthink = oldself.nextthink;
        self.solid = oldself.solid;
+       self.ballistics_density = oldself.ballistics_density;
        self.takedamage = oldself.takedamage;
        self.think = oldself.think;
        self.customizeentityforclient = oldself.customizeentityforclient;
@@ -165,14 +167,13 @@ void CopyBody(float keepvelocity)
 
 float player_getspecies()
 {
+       float s;
        get_model_parameters(self.playermodel, self.skinindex);
-       if(get_model_parameters_species >= 0)
-       {
-               get_model_parameters(string_null, 0);
-               return get_model_parameters_species;
-       }
+       s = get_model_parameters_species;
        get_model_parameters(string_null, 0);
-       return SPECIES_HUMAN;
+       if(s < 0)
+               return SPECIES_HUMAN;
+       return s;
 }
 
 void player_setupanimsformodel()
@@ -433,7 +434,7 @@ 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 && player_cnt < 2) && !inWarmupStage)
+       if((g_arena && numspawned < 2) || (g_ca && ca_players < required_ca_players) && !inWarmupStage)
                return;
 
        if (!g_minstagib)
@@ -487,15 +488,18 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
 
                                        if(sound_allowed(MSG_BROADCAST, attacker))
                                        if(!DEATH_ISWEAPON(deathtype, WEP_LASER) || attacker != self || self.health < 2 * cvar("g_balance_laser_primary_damage") * cvar("g_balance_selfdamagepercent") + 1)
+                                       if(self.health > 1)
                                        // exclude pain sounds for laserjumps as long as you aren't REALLY low on health and would die of the next two
                                        {
-                                               if(self.health > 75) // TODO make a "gentle" version?
+                                               if(deathtype == DEATH_FALL)
+                                                       PlayerSound(playersound_fall, CHAN_PAIN, VOICETYPE_PLAYERSOUND);
+                                               else if(self.health > 75) // TODO make a "gentle" version?
                                                        PlayerSound(playersound_pain100, CHAN_PAIN, VOICETYPE_PLAYERSOUND);
                                                else if(self.health > 50)
                                                        PlayerSound(playersound_pain75, CHAN_PAIN, VOICETYPE_PLAYERSOUND);
                                                else if(self.health > 25)
                                                        PlayerSound(playersound_pain50, CHAN_PAIN, VOICETYPE_PLAYERSOUND);
-                                               else if(self.health > 1)
+                                               else
                                                        PlayerSound(playersound_pain25, CHAN_PAIN, VOICETYPE_PLAYERSOUND);
                                        }
                                }
@@ -622,6 +626,7 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
                self.movetype = MOVETYPE_TOSS;
                // shootable corpse
                self.solid = SOLID_CORPSE;
+               self.ballistics_density = cvar("g_ballistics_density_corpse");
                // don't stick to the floor
                self.flags &~= FL_ONGROUND;
                // dying animation
@@ -658,7 +663,7 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
                // call the corpse damage function just in case it wants to gib
                self.event_damage(inflictor, attacker, 0, deathtype, hitloc, force);
                // set up to fade out later
-               SUB_SetFade (self, time + 12 + random () * 4, 1);
+               SUB_SetFade (self, time + 6 + random (), 1);
 
                // remove laserdot
                if(self.weaponentity)
@@ -853,6 +858,7 @@ float Say(entity source, float teamsay, entity privatesay, string msgin, float f
 {
        string msgstr, colorstr, cmsgstr, namestr, fullmsgstr, sourcemsgstr, fullcmsgstr, sourcecmsgstr, privatemsgprefix;
        float flood, privatemsgprefixlen;
+       var .float flood_field;
        entity head;
        float ret;
 
@@ -934,7 +940,6 @@ float Say(entity source, float teamsay, entity privatesay, string msgin, float f
                float flood_spl;
                float flood_burst;
                float flood_lmax;
-               var .float flood_field;
                float lines;
                if(privatesay)
                {
@@ -996,10 +1001,10 @@ float Say(entity source, float teamsay, entity privatesay, string msgin, float f
                        else
                                flood = 1;
                }
-       }
 
-       if (timeoutStatus == 2) //when game is paused, no flood protection
-               source.flood_field = flood = 0;
+               if (timeoutStatus == 2) //when game is paused, no flood protection
+                       source.flood_field = flood = 0;
+       }
 
        if(flood == 2) // cannot happen for empty msgstr
        {