]> git.rm.cloudns.org Git - voretournament/voretournament.git/commitdiff
Remove some useless code and fix a bug
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sun, 27 Feb 2011 15:49:47 +0000 (17:49 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sun, 27 Feb 2011 15:49:47 +0000 (17:49 +0200)
data/qcsrc/server/vore.qc

index 23e66d44d40350809a0ca25928145d4551225e86..f30e29a1f91fb31ce51a73e1410fc351da28e039 100644 (file)
@@ -257,31 +257,15 @@ void Vore_DeadPrey_Detach(entity e)
 {\r
        // ran when dead prey must be detached from the stomach (eg: they are respawning)\r
 \r
-       if(e.fakepredator.classname != "player")\r
-               return;\r
-\r
-       e.movetype = e.vore_oldmovetype;\r
-       e.view_ofs_z = PL_VIEW_OFS_z;\r
-       e.alpha = default_player_alpha;\r
-\r
-       // if we disconnect dead prey from the predator, gib it's body\r
-       if(e.health <= 0)\r
-               e.health = -1000;\r
-\r
        e.fakepredator = world;\r
+       e.aiment = world;\r
 }\r
 \r
 void Vore_ChoosePreyRelease(entity e)\r
 {\r
        // if the fulldigest feature is on, we don't spit a dead prey's carcass out\r
        if(e.health <= 0 && cvar("g_vore_fulldigest"))\r
-       {\r
                Vore_DeadPrey_Configure(e);\r
-\r
-               // if the predator's dead, we detach the dead prey from him\r
-               if(e.fakepredator.deadflag != DEAD_NO)\r
-                       Vore_DeadPrey_Detach(e);\r
-       }\r
        else\r
                Vore_Regurgitate(e);\r
 }\r
@@ -519,10 +503,17 @@ void Vore()
        if(self.deadflag)\r
        {\r
                Vore_ChoosePreyRelease(self);\r
+\r
+               // if the predator's dead, we detach the dead prey from him\r
+               if(self.fakepredator.classname != "player" || self.fakepredator.deadflag != DEAD_NO)\r
+                       Vore_DeadPrey_Detach(self);\r
+\r
                return;\r
        }\r
+\r
        if(self.predator.classname != "player")\r
                return;\r
+\r
        if(self.predator.deadflag)\r
                Vore_Regurgitate(self);\r
        else if(vlen(self.predator.velocity) > cvar("g_balance_vore_regurgitate_speedcap"))\r