From 6223550131de198e4a77c27f1ebb97b80e33b75a Mon Sep 17 00:00:00 2001 From: MirceaKitsune Date: Mon, 28 Feb 2011 02:40:40 +0200 Subject: [PATCH] Don't taunt if we have team mates in our stomach. Also make checking team mates in the stomach an own function. --- data/qcsrc/server/vore.qc | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/data/qcsrc/server/vore.qc b/data/qcsrc/server/vore.qc index 94d4fb1e..30dcec81 100644 --- a/data/qcsrc/server/vore.qc +++ b/data/qcsrc/server/vore.qc @@ -72,6 +72,22 @@ float Swallow_condition_check(entity prey) return FALSE; } +float Stomach_TeamMates_check(entity pred) +{ + // checks if a player's stomach contains any team mates + + entity head; + if(teams_matter) + { + FOR_EACH_PLAYER(head) + { + if(head.predator == pred && head.team == pred.team) + return TRUE; + } + } + return FALSE; +} + float Vore_CanLeave() { if(self.predator.classname == "player") @@ -150,17 +166,8 @@ void Vore_AutoDigest(entity e) return; // this feature is only for players, not bots if(e.stomach_load > 1) return; // don't start digestion if we already ate someone, as that means we manually disabled it after the first prey and want it off - - entity head; - if(teams_matter) - { - FOR_EACH_PLAYER(head) - { - // never begin automatic digestion if we've swallowed a team mate - if(head.predator == e && head.team == e.team) - return; - } - } + if(Stomach_TeamMates_check(e)) + return; // never begin automatic digestion if we've swallowed a team mate e.digesting = TRUE; } @@ -408,7 +415,7 @@ void Vore_AutoTaunt() // triggers ambient vore taunts, for both pred and prey // predator taunts - if(self.stomach_load) + if(self.stomach_load && !Stomach_TeamMates_check(self)) { // taunt_soundtime is set to 0 after the taunt has played, so this indicates a new start if(!self.taunt_soundtime) -- 2.39.2