]> de.git.xonotic.org Git - voretournament/voretournament.git/blobdiff - data/qcsrc/server/vore.qc
Fix one more bug that broke the old digestion method
[voretournament/voretournament.git] / data / qcsrc / server / vore.qc
index c9adc930e8e5644e5d8e7233416aab195c5b504d..e51b0b81b887702182ce379cc030defa54faf1f7 100644 (file)
@@ -117,7 +117,7 @@ void Vore_CameraEffect_Apply()
 }\r
 \r
 .float gurgle_oldstomachload;\r
-void Vore_Gurglesound()\r
+void Vore_GurgleSound()\r
 {\r
        if(time > self.gurglesound_finished || self.gurgle_oldstomachload != self.stomach_load)\r
        {\r
@@ -128,7 +128,7 @@ void Vore_Gurglesound()
        }\r
 }\r
 \r
-void Vore_Weight_apply(entity e)\r
+void Vore_WeightApply(entity e)\r
 {\r
        // apply stomach weight that makes you heavier the more you eat\r
        // slowing the player is done in cl_physics.qc\r
@@ -179,7 +179,7 @@ void Vore_Swallow(entity e)
        e.predator.stomach_load += 1;\r
        e.predator.regurgitate_prepare = 0;\r
        e.predator.spawnshieldtime = 0; // lose spawn shield when we vore\r
-       Vore_Weight_apply(e.predator);\r
+       Vore_WeightApply(e.predator);\r
 \r
        // block firing for a small amount of time, or we'll be firing the next frame after we swallow\r
        e.predator.weapon_delay = time + button_delay_time;\r
@@ -219,7 +219,7 @@ void Vore_Regurgitate(entity e)
        e.predator.stomach_load -= 1;\r
        e.predator.regurgitate_prepare = 0;\r
        e.predator.swallow_delay = time + cvar("g_balance_vore_swallow_delay");\r
-       Vore_Weight_apply(e.predator);\r
+       Vore_WeightApply(e.predator);\r
 \r
        // block firing for a small amount of time, or we'll be firing the next frame\r
        e.weapon_delay = time + button_delay_time;\r
@@ -231,16 +231,17 @@ void Vore_DeadPrey_Configure(entity e)
 {\r
        // ran when the fulldigest feature is enabled and prey stays inside the stomach after dying\r
 \r
-       if(e.fakepredator.classname == "player" || e.predator.classname != "player") // already configured\r
+       if(e.fakeprey || e.predator.classname != "player") // already configured\r
                return;\r
 \r
        // this entity is like e.predator but for dead prey, to avoid conflicts\r
        e.fakepredator = e.predator;\r
+       e.fakeprey = TRUE;\r
 \r
        // first release the prey from the predator, as dead prey needs to be attached differently\r
        // the predator's stomach load is also decreased, as dead prey doesn't count any more\r
        e.predator.stomach_load -= 1;\r
-       Vore_Weight_apply(e.predator);\r
+       Vore_WeightApply(e.predator);\r
        e.predator = world;\r
 \r
        // now put our dead prey inside the predator's stomach, but only as an effect\r
@@ -251,7 +252,6 @@ void Vore_DeadPrey_Configure(entity e)
 \r
        // completely remove the dead body\r
        e.alpha = -1;\r
-       setmodel(e, "");\r
 }\r
 \r
 void Vore_DeadPrey_Detach(entity e)\r
@@ -264,6 +264,9 @@ void Vore_DeadPrey_Detach(entity e)
 \r
        e.fakepredator = world;\r
        e.aiment = world;\r
+\r
+       if(!e.deadflag)\r
+               e.fakeprey = FALSE;\r
 }\r
 \r
 void Vore_PreyRelease(entity e)\r
@@ -277,7 +280,7 @@ void Vore_PreyRelease(entity e)
                if(self.fakepredator.classname != "player" || self.fakepredator.deadflag != DEAD_NO)\r
                        Vore_DeadPrey_Detach(self);\r
        }\r
-       else\r
+       else if(self.predator.classname != "player")\r
                Vore_Regurgitate(e);\r
 }\r
 \r
@@ -298,7 +301,7 @@ void Vore_Disconnect()
                        if(head.predator == self)\r
                                Vore_PreyRelease(head);\r
                }\r
-               Vore_Gurglesound(); // stop the gurgling sound\r
+               Vore_GurgleSound(); // stop the gurgling sound\r
        }\r
 \r
        self.stomach_load = self.gravity = 0; // prevents a bug\r
@@ -505,7 +508,7 @@ void Vore()
        }\r
 \r
        if(cvar("g_vore_gurglesound"))\r
-               Vore_Gurglesound();\r
+               Vore_GurgleSound();\r
 \r
 // --------------------------------\r
 // Code that addresses the prey:\r