]> de.git.xonotic.org Git - voretournament/voretournament.git/blobdiff - data/qcsrc/server/g_damage.qc
Fix consumable health giving one health unit more than it should
[voretournament/voretournament.git] / data / qcsrc / server / g_damage.qc
index 86e1f1b47607d5b61f805238749bc775c87cb276..4b304b89eb8fcc4b7da34d84ccd720786b503432 100644 (file)
@@ -384,6 +384,7 @@ void Obituary (entity attacker, entity inflictor, entity targ, float deathtype)
                                                }\r
                                                SetAutoTaunt(attacker, time + 1, TAUNTTYPE_DEATH);\r
                                        }\r
+                                       portrait(attacker, targ);\r
                                }\r
                                else\r
                                {\r
@@ -400,6 +401,7 @@ void Obituary (entity attacker, entity inflictor, entity targ, float deathtype)
                                                }\r
                                                SetAutoTaunt(attacker, time + 1, TAUNTTYPE_DEATH);\r
                                        }\r
+                                       portrait(attacker, targ);\r
                                }\r
 \r
                                if(sv_gentle) {\r
@@ -633,6 +635,9 @@ void Obituary (entity attacker, entity inflictor, entity targ, float deathtype)
                        LogDeath("accident", deathtype, targ, targ);\r
                }\r
 \r
+               // we lose all armor when we die\r
+               targ.armorvalue = 0;\r
+\r
                targ.death_origin = targ.origin;\r
                if(targ != attacker)\r
                        targ.killer_origin = attacker.origin;\r
@@ -699,15 +704,8 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
 \r
                // if a predator is taking damage, check if he should regurgitate his prey, based on the damage he took\r
                if(cvar("g_balance_vore_escapeprobability"))\r
-               {\r
-                       entity e;\r
-                       FOR_EACH_PLAYER(e)\r
-                       {\r
-                               if(e.predator != world && e.predator == targ)\r
-                               if(random() < cvar("g_balance_vore_escapeprobability") * damage)\r
-                                       Vore_Regurgitate(e);\r
-                       }\r
-               }\r
+               if(targ.stomach_load && random() < cvar("g_balance_vore_escapeprobability") * damage)\r
+                       targ.regurgitate_prepare = -1;\r
 \r
                // nullify damage if teamplay is on\r
                if(deathtype != DEATH_TELEFRAG)\r
@@ -860,6 +858,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
                                                attacker.teamkill_complain = time + 5;\r
                                                attacker.teamkill_soundtime = time + 0.4;\r
                                                attacker.teamkill_soundsource = targ;\r
+                                               portrait(targ, attacker);\r
                                        }\r
                                }\r
                        }\r
@@ -867,7 +866,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
 \r
                // lean the player based on the amount of damage taken\r
                if(cvar("g_leanplayer_damage"))\r
-               if(deathtype != DEATH_DIGESTION && deathtype != DEATH_STOMACHKICK && deathtype != DEATH_REGURGITATION) // prevents some bugs\r
+               if(targ.classname == "player" && WEP_VALID(DEATH_WEAPONOF(deathtype))) // only for damage caused by weapons\r
                {\r
                        targ.leanangle_damage_loc = hitloc - targ.origin;\r
                        targ.leanangle_damage_force += force * cvar("g_leanplayer_damage"); // keep existing force if any\r