]> git.rm.cloudns.org Git - voretournament/voretournament.git/commitdiff
No vore taunts for dead prey and predators with dead prey in their stomach.
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 1 Aug 2011 13:12:26 +0000 (16:12 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 1 Aug 2011 13:12:26 +0000 (16:12 +0300)
data/qcsrc/server/bot/havocbot/vore_ai.qc
data/qcsrc/server/vore.qc
data/qcsrc/server/vore.qh

index fb98cdffd7c20ccb06aece7af6611ec0bc11e2b5..c308e27aa2578bd4da62f96a5da4887f7b91dbf8 100644 (file)
@@ -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;
                        }
index e8e60c625c3399041f91411c2ced2a43e020425b..e053463942403b37b712b920bb8e2275401ffd55 100644 (file)
@@ -89,6 +89,18 @@ float Stomach_TeamMates_check(entity pred)
        return FALSE;\r
 }\r
 \r
+float Stomach_HasLivePrey(entity pred)\r
+{\r
+       entity head;\r
+       FOR_EACH_PLAYER(head)\r
+       {\r
+               if(head.predator == pred)\r
+               if(head.deadflag == DEAD_NO)\r
+                       return TRUE;\r
+       }\r
+       return FALSE;\r
+}\r
+\r
 float Vore_CanLeave()\r
 {\r
        if(self.stat_eaten)\r
@@ -552,7 +564,7 @@ void Vore_AutoTaunt()
        float taunt_time;\r
 \r
        // predator taunts\r
-       if(self.stomach_load && !Stomach_TeamMates_check(self))\r
+       if(self.stomach_load && !Stomach_TeamMates_check(self) && Stomach_HasLivePrey(self))\r
        {\r
                if(!self.taunt_soundtime) // taunt_soundtime becomes 0 once the taunt has played\r
                {\r
@@ -567,7 +579,7 @@ void Vore_AutoTaunt()
        }\r
 \r
        // prey taunts\r
-       if(self.stat_eaten && !(teams_matter && self.team == self.predator.team))\r
+       if(self.stat_eaten && !(teams_matter && self.team == self.predator.team) && self.deadflag == DEAD_NO)\r
        {\r
                if(!self.taunt_soundtime) // taunt_soundtime becomes 0 once the taunt has played\r
                {\r
index 93b92996c5e260648cb2645a2401adb9a0f88d90..07fde63c629320de174570d41b20334b272d6507 100644 (file)
@@ -3,4 +3,5 @@ void Vore_Regurgitate(entity e);
 void Vore_Disconnect();\r
 \r
 entity Swallow_player_check();\r
-float Swallow_condition_check(entity prey);
\ No newline at end of file
+float Swallow_condition_check(entity prey);\r
+float Stomach_HasLivePrey(entity pred);
\ No newline at end of file