]> git.rm.cloudns.org Git - voretournament/voretournament.git/commitdiff
Fix the stealprey feature. Now it finally works as it should be
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 9 Sep 2010 21:13:26 +0000 (00:13 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 9 Sep 2010 21:13:26 +0000 (00:13 +0300)
data/qcsrc/server/vore.qc

index 151cad9d67b5a06c5ec4e087c41a2fc464847e34..218978834b9575bd7c1c84e1837a315e1d47f7f1 100644 (file)
@@ -328,19 +328,21 @@ void Vore()
        // this code has a high priority and must not be stopped by any delay, so run it here\r
        if(self.predator.predator.classname == "player")\r
        {\r
+               entity target_predator, target_predator_predator, oldself;\r
+               target_predator = self.predator;\r
+               target_predator_predator = self.predator.predator;\r
+\r
                Vore_Regurgitate(self);\r
 \r
                // now steal our prey's prey if this probability applies\r
-               entity target_predator, oldself;\r
-               target_predator = self.predator.predator;\r
-\r
                if(random() < cvar("g_vore_stealprey"))\r
-               if(Swallow_condition_check(self))\r
-               if not(teams_matter && self.predator.team == target_predator.team) // don't steal a team mate's prey\r
                {\r
                        oldself = self;\r
-                       self = target_predator;\r
-                       Vore_Swallow(oldself);\r
+                       self = target_predator_predator;\r
+                       if(Swallow_condition_check(oldself))\r
+                       if not(teams_matter && self.team == target_predator.team) // don't steal a team mate's prey\r
+                       if not(teams_matter && self.team == oldself.team) // if the prey we would be stealing is a team mate, don't do it\r
+                               Vore_Swallow(oldself);\r
                        self = oldself;\r
                }\r
        }\r