From: MirceaKitsune Date: Mon, 1 Aug 2011 13:12:26 +0000 (+0300) Subject: No vore taunts for dead prey and predators with dead prey in their stomach. X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=20e959f2382dbe4204409a59fc273395eacde4a3;p=voretournament%2Fvoretournament.git No vore taunts for dead prey and predators with dead prey in their stomach. --- diff --git a/data/qcsrc/server/bot/havocbot/vore_ai.qc b/data/qcsrc/server/bot/havocbot/vore_ai.qc index fb98cdff..c308e27a 100644 --- a/data/qcsrc/server/bot/havocbot/vore_ai.qc +++ b/data/qcsrc/server/bot/havocbot/vore_ai.qc @@ -190,15 +190,7 @@ void Vore_AI() // he can gain from digestion, there's no reason to keep the dead prey any longer if(cvar("g_balance_vore_digestion_limit") < 0 && skill >= 9) // such awareness comes from skill level 9 and up { - float found_live_prey; - FOR_EACH_PLAYER(head) - { - if(head.predator == self) - if(head.deadflag == DEAD_NO) - found_live_prey = TRUE; - } - - if(!found_live_prey) + if(!Stomach_HasLivePrey(self)) if(self.health >= cvar("g_balance_vore_digestion_vampire_stable")) self.BUTTON_REGURGITATE = TRUE; } diff --git a/data/qcsrc/server/vore.qc b/data/qcsrc/server/vore.qc index e8e60c62..e0534639 100644 --- a/data/qcsrc/server/vore.qc +++ b/data/qcsrc/server/vore.qc @@ -89,6 +89,18 @@ float Stomach_TeamMates_check(entity pred) return FALSE; } +float Stomach_HasLivePrey(entity pred) +{ + entity head; + FOR_EACH_PLAYER(head) + { + if(head.predator == pred) + if(head.deadflag == DEAD_NO) + return TRUE; + } + return FALSE; +} + float Vore_CanLeave() { if(self.stat_eaten) @@ -552,7 +564,7 @@ void Vore_AutoTaunt() float taunt_time; // predator taunts - if(self.stomach_load && !Stomach_TeamMates_check(self)) + if(self.stomach_load && !Stomach_TeamMates_check(self) && Stomach_HasLivePrey(self)) { if(!self.taunt_soundtime) // taunt_soundtime becomes 0 once the taunt has played { @@ -567,7 +579,7 @@ void Vore_AutoTaunt() } // prey taunts - if(self.stat_eaten && !(teams_matter && self.team == self.predator.team)) + if(self.stat_eaten && !(teams_matter && self.team == self.predator.team) && self.deadflag == DEAD_NO) { if(!self.taunt_soundtime) // taunt_soundtime becomes 0 once the taunt has played { diff --git a/data/qcsrc/server/vore.qh b/data/qcsrc/server/vore.qh index 93b92996..07fde63c 100644 --- a/data/qcsrc/server/vore.qh +++ b/data/qcsrc/server/vore.qh @@ -3,4 +3,5 @@ void Vore_Regurgitate(entity e); void Vore_Disconnect(); entity Swallow_player_check(); -float Swallow_condition_check(entity prey); \ No newline at end of file +float Swallow_condition_check(entity prey); +float Stomach_HasLivePrey(entity pred); \ No newline at end of file