From: MirceaKitsune Date: Sun, 31 Jul 2011 19:59:40 +0000 (+0300) Subject: Spawn gibs when regurgitating a dead body below gib health X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b8b4c8ca8ca12b09a992e5b722b352cc04c2b6cd;p=voretournament%2Fvoretournament.git Spawn gibs when regurgitating a dead body below gib health --- diff --git a/data/qcsrc/server/cl_player.qc b/data/qcsrc/server/cl_player.qc index b8ca620e..14a35473 100644 --- a/data/qcsrc/server/cl_player.qc +++ b/data/qcsrc/server/cl_player.qc @@ -418,18 +418,7 @@ void PlayerCorpseDamage (entity inflictor, entity attacker, float damage, float self.dmg_take = self.dmg_take + take;//max(take - 10, 0); self.dmg_inflictor = inflictor; - if (self.health <= -cvar("sv_gibhealth") && self.modelindex != 0) - { - // don't use any animations as a gib - self.frame = 0; - self.dead_frame = 0; - // view just above the floor - self.view_ofs = '0 0 4'; - - Violence_GibSplash(self, 1, 1, attacker); - self.modelindex = 0; // restore later - self.solid = SOLID_NOT; // restore later - } + PlayerGib(self, attacker); } void ClientKill_Now_TeamChange(); diff --git a/data/qcsrc/server/vore.qc b/data/qcsrc/server/vore.qc index afe74a06..e8e60c62 100644 --- a/data/qcsrc/server/vore.qc +++ b/data/qcsrc/server/vore.qc @@ -369,6 +369,10 @@ void Vore_Regurgitate(entity e) e.pusher = e.predator; // allows us to frag players by regurgitating them in deadly pits e.pushltime = time + cvar("g_maxpushtime"); + // if the dead body of the prey is below gibbing health, gib it + e.stat_eaten = 0; // necessary for gibs to show + PlayerGib(e, e.predator); + // regurgitated prey is given this amount of swallow progress, to simulate being more vulnerable if(cvar("g_balance_vore_swallow_speed_fill") && cvar("g_balance_vore_regurgitate_swallowprogress")) { diff --git a/data/qcsrc/server/w_common.qc b/data/qcsrc/server/w_common.qc index d682eb13..9a104946 100644 --- a/data/qcsrc/server/w_common.qc +++ b/data/qcsrc/server/w_common.qc @@ -479,3 +479,22 @@ void W_PrepareExplosionByDamage(entity attacker, void() explode) self.nextthink = time; self.think = explode; } + +void PlayerGib(entity e, entity attacker) +{ + if(e.stat_eaten) + return; // you can't gib outside of the stomach + + if (e.health <= -cvar("sv_gibhealth") && e.modelindex != 0) + { + // don't use any animations as a gib + e.frame = 0; + e.dead_frame = 0; + // view just above the floor + e.view_ofs = '0 0 4'; + + Violence_GibSplash(e, 1, 1, attacker); + e.modelindex = 0; // restore later + e.solid = SOLID_NOT; // restore later + } +}