]> git.rm.cloudns.org Git - voretournament/voretournament.git/commitdiff
Spawn gibs when regurgitating a dead body below gib health
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sun, 31 Jul 2011 19:59:40 +0000 (22:59 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sun, 31 Jul 2011 19:59:40 +0000 (22:59 +0300)
data/qcsrc/server/cl_player.qc
data/qcsrc/server/vore.qc
data/qcsrc/server/w_common.qc

index b8ca620e7b043fcbba0608893ddd6c096683414a..14a35473f9fadbb6fa7c81a960f4febdabb914f7 100644 (file)
@@ -418,18 +418,7 @@ void PlayerCorpseDamage (entity inflictor, entity attacker, float damage, float
        self.dmg_take = self.dmg_take + take;//max(take - 10, 0);\r
        self.dmg_inflictor = inflictor;\r
 \r
-       if (self.health <= -cvar("sv_gibhealth") && self.modelindex != 0)\r
-       {\r
-               // don't use any animations as a gib\r
-               self.frame = 0;\r
-               self.dead_frame = 0;\r
-               // view just above the floor\r
-               self.view_ofs = '0 0 4';\r
-\r
-               Violence_GibSplash(self, 1, 1, attacker);\r
-               self.modelindex = 0; // restore later\r
-               self.solid = SOLID_NOT; // restore later\r
-       }\r
+       PlayerGib(self, attacker);\r
 }\r
 \r
 void ClientKill_Now_TeamChange();\r
index afe74a06c383117c4aa00c2322d24bea4e3e6352..e8e60c625c3399041f91411c2ced2a43e020425b 100644 (file)
@@ -369,6 +369,10 @@ void Vore_Regurgitate(entity e)
        e.pusher = e.predator; // allows us to frag players by regurgitating them in deadly pits\r
        e.pushltime = time + cvar("g_maxpushtime");\r
 \r
+       // if the dead body of the prey is below gibbing health, gib it\r
+       e.stat_eaten = 0; // necessary for gibs to show\r
+       PlayerGib(e, e.predator);\r
+\r
        // regurgitated prey is given this amount of swallow progress, to simulate being more vulnerable\r
        if(cvar("g_balance_vore_swallow_speed_fill") && cvar("g_balance_vore_regurgitate_swallowprogress"))\r
        {\r
index d682eb13fd1e437f75df2314e52918b3397a4ee6..9a10494616a05cbac79aa430bf686f713ab666be 100644 (file)
@@ -479,3 +479,22 @@ void W_PrepareExplosionByDamage(entity attacker, void() explode)
        self.nextthink = time;\r
        self.think = explode;\r
 }\r
+\r
+void PlayerGib(entity e, entity attacker)\r
+{\r
+       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
+       {\r
+               // don't use any animations as a gib\r
+               e.frame = 0;\r
+               e.dead_frame = 0;\r
+               // view just above the floor\r
+               e.view_ofs = '0 0 4';\r
+\r
+               Violence_GibSplash(e, 1, 1, attacker);\r
+               e.modelindex = 0; // restore later\r
+               e.solid = SOLID_NOT; // restore later\r
+       }\r
+}\r