]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cl_player.qc
Merge remote-tracking branch 'origin/master' into samual/weapons
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cl_player.qc
index 2aae32abb053484b3e37302e53ff29eecd0d77c6..e7256766607d87988296dbae02556508435423b7 100644 (file)
@@ -273,7 +273,7 @@ void PlayerCorpseDamage (entity inflictor, entity attacker, float damage, float
        // damage resistance (ignore most of the damage from a bullet or similar)
        damage = max(damage - 5, 1);
 
-       v = healtharmor_applydamage(self.armorvalue, autocvar_g_balance_armor_blockpercent, damage);
+       v = healtharmor_applydamage(self.armorvalue, autocvar_g_balance_armor_blockpercent, deathtype, damage);
        take = v_x;
        save = v_y;
 
@@ -350,7 +350,10 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
                ear1 += v_right * -10;
                ear2 += v_right * +10;
                d = inflictor.origin - self.origin;
-               f = (d * v_right) / vlen(d); // this is cos of angle of d and v_right!
+               if (d)
+                       f = (d * v_right) / vlen(d); // this is cos of angle of d and v_right!
+               else
+                       f = 0;  // Assum ecenter.
                force = v_right * vlen(force);
                Violence_GibSplash_At(ear1, force * -1, 2, bound(0, damage, 25) / 2 * (0.5 - 0.5 * f), self, attacker);
                Violence_GibSplash_At(ear2, force,      2, bound(0, damage, 25) / 2 * (0.5 + 0.5 * f), self, attacker);
@@ -369,7 +372,7 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
                Violence_GibSplash_At(hitloc, force, 2, bound(0, damage, 200) / 16, self, attacker);
 
 
-       v = healtharmor_applydamage(self.armorvalue, autocvar_g_balance_armor_blockpercent, damage);
+       v = healtharmor_applydamage(self.armorvalue, autocvar_g_balance_armor_blockpercent, deathtype, damage);
        take = v_x;
        save = v_y;
 
@@ -631,6 +634,10 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
                        self.respawn_time = ceil((time + sdelay) / waves) * waves;
                else
                        self.respawn_time = time + sdelay;
+               if(autocvar_g_respawn_delay_max > sdelay)
+                       self.respawn_time_max = time + autocvar_g_respawn_delay_max;
+               else
+                       self.respawn_time_max = self.respawn_time;
                if((sdelay + waves >= 5.0) && (self.respawn_time - time > 1.75))
                        self.respawn_countdown = 10; // first number to count down from is 10
                else
@@ -691,7 +698,7 @@ float Say(entity source, float teamsay, entity privatesay, string msgin, float f
 
        msgin = formatmessage(msgin);
 
-       if not(IS_PLAYER(source))
+       if (!IS_PLAYER(source))
                colorstr = "^0"; // black for spectators
        else if(teamplay)
                colorstr = Team_ColorCode(source.team);
@@ -851,9 +858,9 @@ float Say(entity source, float teamsay, entity privatesay, string msgin, float f
        }
 
        if(!privatesay)
-       if not(IS_PLAYER(source))
+       if (!IS_PLAYER(source))
        {
-               if not(intermission_running)
+               if (!intermission_running)
                        if(teamsay || (autocvar_g_chat_nospectators == 1) || (autocvar_g_chat_nospectators == 2 && !(warmup_stage || gameover)))
                                teamsay = -1; // spectators
        }
@@ -897,7 +904,7 @@ float Say(entity source, float teamsay, entity privatesay, string msgin, float f
                {
                        sprint(source, sourcemsgstr);
                        sprint(privatesay, msgstr);
-                       if not(autocvar_g_chat_tellprivacy) { dedicated_print(msgstr); } // send to server console too if "tellprivacy" is disabled
+                       if (!autocvar_g_chat_tellprivacy) { dedicated_print(msgstr); } // send to server console too if "tellprivacy" is disabled
                        if(cmsgstr != "")
                                centerprint(privatesay, cmsgstr);
                }
@@ -919,7 +926,7 @@ float Say(entity source, float teamsay, entity privatesay, string msgin, float f
                {
                        sprint(source, sourcemsgstr);
                        dedicated_print(msgstr); // send to server console too
-                       FOR_EACH_REALCLIENT(head) if not(IS_PLAYER(head))
+                       FOR_EACH_REALCLIENT(head) if (!IS_PLAYER(head))
                                if(head != source)
                                        sprint(head, msgstr);
                }
@@ -1008,7 +1015,7 @@ void PrecachePlayerSounds(string f)
        }
        fclose(fh);
 
-       if not(allvoicesamples)
+       if (!allvoicesamples)
        {
 #define _VOICEMSG(m) allvoicesamples = strcat(allvoicesamples, " ", #m);
                ALLVOICEMSGS