]> de.git.xonotic.org Git - voretournament/voretournament.git/blobdiff - data/qcsrc/server/vore.qc
Only use the event chasecam when we aren't fake prey (dead and outside of the stomach)
[voretournament/voretournament.git] / data / qcsrc / server / vore.qc
index ac8d5b48d04d7687794a79cc62ba98436fd8ab7b..9837a563848b0081e3378a66139958a325aeb7d3 100644 (file)
@@ -67,6 +67,18 @@ float Swallow_condition_check(entity prey)
                        return FALSE;\r
                }\r
 \r
+               if(!cvar("g_vore_spawnshield"))\r
+               if(prey.spawnshieldtime > time)\r
+               {\r
+                       if(time > self.complain_vore && self.BUTTON_ATCK)\r
+                       {\r
+                               play2(self, "misc/forbidden.wav");\r
+                               sprint(self, "You cannot swallow someone protected by the spawn shield\n");\r
+                               self.complain_vore = time + complain_delay_time;\r
+                       }\r
+                       return FALSE;\r
+               }\r
+\r
                return TRUE;\r
        }\r
        return FALSE;\r
@@ -305,20 +317,21 @@ void Vore_DeadPrey_Detach(entity e)
 \r
 void Vore_PreyRelease(entity e, float pred_disconnect)\r
 {\r
-       // if the keepdeadprey feature is on, don't spit a dead prey's carcass out\r
-       if(e.deadflag != DEAD_NO && cvar("g_vore_keepdeadprey"))\r
+       if(pred_disconnect)\r
        {\r
-               // if keepdeadprey is enabled and the predator disconnected, detach the dead prey\r
-               if(pred_disconnect)\r
-               {\r
-                       if(e.fakeprey)\r
-                               Vore_DeadPrey_Detach(e);\r
-               }\r
+               if(e.fakeprey)\r
+                       Vore_DeadPrey_Detach(e);\r
                else\r
-                       Vore_DeadPrey_Configure(e);\r
+                       Vore_Regurgitate(e);\r
        }\r
        else\r
-               Vore_Regurgitate(e);\r
+       {\r
+               // if the keepdeadprey feature is on, don't spit a dead prey's carcass out\r
+               if(e.deadflag != DEAD_NO && random() < cvar("g_vore_keepdeadprey"))\r
+                       Vore_DeadPrey_Configure(e);\r
+               else\r
+                       Vore_Regurgitate(e);\r
+       }\r
 }\r
 \r
 void Vore_Disconnect()\r
@@ -487,8 +500,10 @@ void Vore()
                        self.colormod_z = 1;\r
        }\r
 \r
-       // set all vore related stats\r
-       if(self.predator.classname == "player")\r
+       // set all vore stats\r
+       if(self.fakeprey)\r
+               self.stat_eaten = num_for_edict(self.fakepredator);\r
+       else if(self.predator.classname == "player")\r
        {\r
                self.stat_stomachload = self.predator.stomach_load; // necessary for the stomach board\r
                self.stat_digesting = self.predator.digesting; // necessary for the stomach board\r
@@ -649,4 +664,8 @@ void Vore()
                Vore_StomachLeave();\r
 \r
        Vore_CameraEffect_Apply();\r
+\r
+       // Ugly workaround for a Keyhunt issue. Your team's key can still be given to you while in the stomach\r
+       // (at round start), which is pretty ugly and wrong. So attempt to drop keys each frame for prey\r
+       kh_Key_DropAll(self, FALSE);\r
 }
\ No newline at end of file