From: MirceaKitsune Date: Thu, 9 Sep 2010 21:13:26 +0000 (+0300) Subject: Fix the stealprey feature. Now it finally works as it should be X-Git-Url: http://de.git.xonotic.org/?a=commitdiff_plain;h=96b08a2637da12b4f55e4960fcb23bedd8c3a77a;p=voretournament%2Fvoretournament.git Fix the stealprey feature. Now it finally works as it should be --- diff --git a/data/qcsrc/server/vore.qc b/data/qcsrc/server/vore.qc index 151cad9d..21897883 100644 --- a/data/qcsrc/server/vore.qc +++ b/data/qcsrc/server/vore.qc @@ -328,19 +328,21 @@ void Vore() // this code has a high priority and must not be stopped by any delay, so run it here if(self.predator.predator.classname == "player") { + entity target_predator, target_predator_predator, oldself; + target_predator = self.predator; + target_predator_predator = self.predator.predator; + Vore_Regurgitate(self); // now steal our prey's prey if this probability applies - entity target_predator, oldself; - target_predator = self.predator.predator; - if(random() < cvar("g_vore_stealprey")) - if(Swallow_condition_check(self)) - if not(teams_matter && self.predator.team == target_predator.team) // don't steal a team mate's prey { oldself = self; - self = target_predator; - Vore_Swallow(oldself); + self = target_predator_predator; + if(Swallow_condition_check(oldself)) + if not(teams_matter && self.team == target_predator.team) // don't steal a team mate's prey + if not(teams_matter && self.team == oldself.team) // if the prey we would be stealing is a team mate, don't do it + Vore_Swallow(oldself); self = oldself; } }