From: MirceaKitsune Date: Mon, 6 Sep 2010 17:58:02 +0000 (+0300) Subject: Move the rest of the swallowing code in the right place X-Git-Url: https://de.git.xonotic.org/?a=commitdiff_plain;h=940a85e707443bcae9401ffb5643c0c788486f17;hp=22bd387815512ca61abbb6ca772103da931ec13c;p=voretournament%2Fvoretournament.git Move the rest of the swallowing code in the right place --- diff --git a/data/qcsrc/server/vore.qc b/data/qcsrc/server/vore.qc index 4dff84a1..e6cb21e4 100644 --- a/data/qcsrc/server/vore.qc +++ b/data/qcsrc/server/vore.qc @@ -104,6 +104,7 @@ void Vore_Swallow(entity e) e.vore_oldsolid = e.solid; e.vore_oldview_ofs_z = e.view_ofs_z; + e.eater = self; setorigin(e, e.eater.origin); e.velocity = '0 0 0'; e.movetype = MOVETYPE_FOLLOW; @@ -121,12 +122,18 @@ void Vore_Swallow(entity e) if(stov(cvar_string("g_vore_regurgitatecolor_released"))) e.colormod = stov(cvar_string("g_vore_regurgitatecolor_released")); + if(e.eater.team == e.team && teamplay) + centerprint(e.eater, "^4You have swallowed a team mate, use caution!"); + PlayerSound(e.eater, playersound_swallow, CHAN_PAIN, VOICETYPE_PLAYERSOUND); setanim(e.eater, e.eater.anim_pain1, FALSE, TRUE, TRUE); // looks good for swallowing / regurgitating e.eater.stomach_load += 1; e.eater.regurgitate_prepare = 0; Vore_Weight_apply(e.eater); + // block firing for a small amount of time when voring, or we'll be firing the next frame after we swallow + e.eater.weapon_delay = time + button_delay; + e.eater.swallow_delay = time + cvar("g_balance_vore_swallow_delay"); e.system_delay = e.eater.system_delay = time + system_delay_time; } @@ -294,17 +301,7 @@ void Vore() // attempt to swallow our new prey if there's any in range if(self.BUTTON_ATCK && !self.BUTTON_REGURGITATE && self.swallow_delay < time) if(Swallow_condition_check(prey)) - { - prey.eater = self; Vore_Swallow(prey); - self.swallow_delay = time + cvar("g_balance_vore_swallow_delay"); - - if(self.team == prey.team && teamplay) - centerprint(self, "You have swallowed a team mate, use caution!"); - - // block firing for a small amount of time when voring, or we'll be firing the next frame after we swallow - self.weapon_delay = time + 0.25; - } // start / stop digestion on command, if the player has someone in their stomach if(self.BUTTON_DIGEST)