]> de.git.xonotic.org Git - voretournament/voretournament.git/blobdiff - data/qcsrc/server/vore.qc
Add a message that lets us know we can leave the belly, when it's the case
[voretournament/voretournament.git] / data / qcsrc / server / vore.qc
index 48ea0c6e8d63ddf3a3a042967f39c5bc44e4a1f1..f6f4165dffedd3c5e7d4fa047cc52f7a4a1911ac 100644 (file)
@@ -56,6 +56,13 @@ float Swallow_condition_check(entity prey)
        return FALSE;\r
 }\r
 \r
+float Vore_PreyCanLeave()\r
+{\r
+       if(teams_matter && self.team == self.eater.team)\r
+               return TRUE;\r
+       return FALSE;\r
+}\r
+\r
 // make the camera smoothly lower itself when we get swallowed\r
 // the target we are going for is from normal view offset to half of the view offset (because half is the best positioning of the view for the stomach model)\r
 .float cameraeffect_current, cameraeffect_target;\r
@@ -266,10 +273,7 @@ void Vore_StomachLeave()
 {\r
        // allows players to get out of their predator at will in some circumstances, such as team mates\r
 \r
-       float canleave;\r
-       canleave = (teams_matter && self.team == self.eater.team); // currently, the only circumstance where you can use this if for team mates\r
-\r
-       if(canleave)\r
+       if(Vore_PreyCanLeave())\r
                Vore_Regurgitate(self);\r
        else if(time > self.complain_swallow)\r
        {\r
@@ -419,5 +423,7 @@ void Vore()
        else if(self.BUTTON_ATCK2)\r
                Vore_StomachLeave();\r
 \r
+       self.stat_canleave = Vore_PreyCanLeave();\r
+\r
        Vore_CameraEffect_Apply();\r
 }
\ No newline at end of file