]> de.git.xonotic.org Git - voretournament/voretournament.git/commitdiff
Don't taunt if we have team mates in our stomach. Also make checking team mates in...
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 28 Feb 2011 00:40:40 +0000 (02:40 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 28 Feb 2011 00:40:40 +0000 (02:40 +0200)
data/qcsrc/server/vore.qc

index 94d4fb1e293c052546904537f272ddfd28caa26f..30dcec81c016b58f58073a376c16800b4b3ead21 100644 (file)
@@ -72,6 +72,22 @@ float Swallow_condition_check(entity prey)
        return FALSE;\r
 }\r
 \r
        return FALSE;\r
 }\r
 \r
+float Stomach_TeamMates_check(entity pred)\r
+{\r
+       // checks if a player's stomach contains any team mates\r
+\r
+       entity head;\r
+       if(teams_matter)\r
+       {\r
+               FOR_EACH_PLAYER(head)\r
+               {\r
+                       if(head.predator == pred && head.team == pred.team)\r
+                               return TRUE;\r
+               }\r
+       }\r
+       return FALSE;\r
+}\r
+\r
 float Vore_CanLeave()\r
 {\r
        if(self.predator.classname == "player")\r
 float Vore_CanLeave()\r
 {\r
        if(self.predator.classname == "player")\r
@@ -150,17 +166,8 @@ void Vore_AutoDigest(entity e)
                return; // this feature is only for players, not bots\r
        if(e.stomach_load > 1)\r
                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\r
                return; // this feature is only for players, not bots\r
        if(e.stomach_load > 1)\r
                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\r
-\r
-       entity head;\r
-       if(teams_matter)\r
-       {\r
-               FOR_EACH_PLAYER(head)\r
-               {\r
-                       // never begin automatic digestion if we've swallowed a team mate\r
-                       if(head.predator == e && head.team == e.team)\r
-                               return;\r
-               }\r
-       }\r
+       if(Stomach_TeamMates_check(e))\r
+               return; // never begin automatic digestion if we've swallowed a team mate\r
 \r
        e.digesting = TRUE;\r
 }\r
 \r
        e.digesting = TRUE;\r
 }\r
@@ -408,7 +415,7 @@ void Vore_AutoTaunt()
        // triggers ambient vore taunts, for both pred and prey\r
 \r
        // predator taunts\r
        // triggers ambient vore taunts, for both pred and prey\r
 \r
        // predator taunts\r
-       if(self.stomach_load)\r
+       if(self.stomach_load && !Stomach_TeamMates_check(self))\r
        {\r
                // taunt_soundtime is set to 0 after the taunt has played, so this indicates a new start\r
                if(!self.taunt_soundtime)\r
        {\r
                // taunt_soundtime is set to 0 after the taunt has played, so this indicates a new start\r
                if(!self.taunt_soundtime)\r