]> de.git.xonotic.org Git - voretournament/voretournament.git/blobdiff - data/qcsrc/server/g_damage.qc
Fix a silly bug, that caused the world to be treated as a predator when taking damage...
[voretournament/voretournament.git] / data / qcsrc / server / g_damage.qc
index 35eb1f551468327c19093bfabc048034d77a9ba9..8bb67e1cc059d9f1eaefc6d0071408a0073a30ad 100644 (file)
@@ -293,6 +293,8 @@ void Obituary (entity attacker, entity inflictor, entity targ, float deathtype)
                                        bprint ("^1",s, "^1 burned to death\n");\r
                                else if (deathtype == DEATH_DIGESTION)\r
                                        bprint ("^1",s, "^1 was digested\n");\r
+                               else if (deathtype == DEATH_REGURGITATION)\r
+                                       bprint ("^1",s, "^1 regurgitated to death\n");\r
                                else if (deathtype == DEATH_STOMACHKICK)\r
                                        bprint ("^1",s, "^1 was ripped apart from the inside\n");\r
                                else if (deathtype != DEATH_TEAMCHANGE && deathtype != DEATH_QUIET)\r
@@ -463,6 +465,8 @@ void Obituary (entity attacker, entity inflictor, entity targ, float deathtype)
                                                bprint ("^1",s, "^1 was burnt to death by ^1", a, "\n");\r
                                        else if (deathtype == DEATH_DIGESTION)\r
                                                bprint ("^1",s, "^1 was digested by ^1", a, "\n");\r
+                                       else if (deathtype == DEATH_REGURGITATION)\r
+                                               bprint ("^1",s, "^1 regurgitated to death due to ^1", a, "\n");\r
                                        else if (deathtype == DEATH_STOMACHKICK)\r
                                                bprint ("^1",s, "^1 was ripped apart from the inside by ^1", a, "\n");\r
                                        else if (deathtype == DEATH_CUSTOM)\r
@@ -693,14 +697,14 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
                if (attacker.isbot)\r
                        damage = damage * bound(0.1, (skill + 5) * 0.1, 1);\r
 \r
-               // if a predator is taking damage, check if he should regurgitate any prey\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 == targ)\r
-                               if(random() < cvar("g_balance_vore_escapeprobability"))\r
+                               if(e.predator != world && e.predator == targ)\r
+                               if(random() < cvar("g_balance_vore_escapeprobability") * damage)\r
                                        Vore_Regurgitate(e);\r
                        }\r
                }\r