]> de.git.xonotic.org Git - voretournament/voretournament.git/commitdiff
Make small dead bodies more likely to gib, and large ones less likely
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 2 Aug 2011 14:26:54 +0000 (17:26 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 2 Aug 2011 14:26:54 +0000 (17:26 +0300)
data/defaultVT.cfg
data/qcsrc/server/w_common.qc

index 40633f0b59ba0d3d1e2c07cd034d0b7fb10599bb..38346f643a9f58d9b711b1088d5472aa2719faed 100644 (file)
@@ -299,7 +299,7 @@ set g_respawn_ghosts 1 "if 1 dead bodies become ghosts and float away when the p
 set g_respawn_ghosts_speed 5 "the speed with which respawn ghosts float and rotate"\r
 set g_respawn_ghosts_maxtime 6 "maximum amount of time a respawn ghost can last, minimum time is half this value. 0 disables and ghosts fade when the body would"\r
 \r
-set sv_gibhealth 75 "Minus health a dead body must have in order to get gibbed"\r
+set sv_gibhealth -75 "Amount of health a dead body must have in order to get gibbed"\r
 \r
 // fragmessage: This allows extra information to be displayed with the frag centerprints. \r
 set sv_fragmessage_information_ping 0 "Enable ping display information, 0 = Never display; 1 = Always display (If the player is a bot, it will say bot instead of the ping.)"\r
index 9a10494616a05cbac79aa430bf686f713ab666be..7998dfb3722fa3f77fc8c868e8effb132d7d08dc 100644 (file)
@@ -485,7 +485,14 @@ void PlayerGib(entity e, entity attacker)
        if(e.stat_eaten)\r
                return; // you can't gib outside of the stomach\r
 \r
-       if (e.health <= -cvar("sv_gibhealth") && e.modelindex != 0)\r
+       float gib_health;\r
+       gib_health = cvar("sv_gibhealth");\r
+       if(gib_health > 0) // someone is being stupid\r
+               gib_health = 0;\r
+       if(cvar("g_healthsize")) // smaller bodies are more likely to gib, and vice versa\r
+               gib_health *= e.scale;\r
+\r
+       if (e.health <= gib_health && e.modelindex != 0)\r
        {\r
                // don't use any animations as a gib\r
                e.frame = 0;\r