]> de.git.xonotic.org Git - voretournament/voretournament.git/blobdiff - data/qcsrc/server/vore.qc
Fix a bug causing consumable items to be instantly regurgitated in Arena games, if...
[voretournament/voretournament.git] / data / qcsrc / server / vore.qc
index 837a5210d61920c605e7cffdc8f745f1b9209a0e..e26b6a62d253c9de90b9dc039fe8a0a22e6b643f 100644 (file)
@@ -450,7 +450,7 @@ void Vore_Regurgitate(entity e)
        e.predator = world;\r
 }\r
 \r
-void Vore_Disconnect()\r
+void Vore_Disconnect(float consumables)\r
 {\r
        // frees prey from their predators when someone disconnects or goes spectating, or in other circumstances\r
        entity e;\r
@@ -467,10 +467,13 @@ void Vore_Disconnect()
                        Vore_Regurgitate(head);\r
        }\r
        // remove consumable items when we disconnect\r
-       for(e = world; (e = find(e, classname, "consumable")); )\r
+       if(consumables)\r
        {\r
-               if(e.predator == self)\r
-                       Item_Consumable_Remove(e, TRUE);\r
+               for(e = world; (e = find(e, classname, "consumable")); )\r
+               {\r
+                       if(e.predator == self)\r
+                               Item_Consumable_Remove(e, TRUE);\r
+               }\r
        }\r
 \r
        self.stomach_load = self.gravity = 0; // prevents a bug\r
@@ -776,12 +779,12 @@ void Vore()
        // apply delays and skip the vore system under some circumstances\r
        if(!cvar("g_vore")) // the vore system is disabled\r
        {\r
-               Vore_Disconnect();\r
+               Vore_Disconnect(TRUE);\r
                return;\r
        }\r
        if(time < game_starttime || (time < warmup && !inWarmupStage)) // don't allow vore before a round begins\r
        {\r
-               Vore_Disconnect();\r
+               Vore_Disconnect(FALSE);\r
                return;\r
        }\r
        if(self.spectatee_status)\r