]> git.rm.cloudns.org Git - voretournament/voretournament.git/commitdiff
Also show the swallow model to a prey that's been regurgitated, if we give them swall...
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sun, 10 Jul 2011 21:29:31 +0000 (00:29 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sun, 10 Jul 2011 21:29:31 +0000 (00:29 +0300)
data/qcsrc/server/vore.qc

index b99e4c1785244f3ba20434175b62beb65d2c0a69..9f9dd7657096d03d13206a785dec349704047ef7 100644 (file)
@@ -222,7 +222,7 @@ void Vore_SwallowModel_Think()
        self.nextthink = time;\r
 }\r
 \r
-void Vore_SwallowModel_Update(entity prey)\r
+void Vore_SwallowModel_Update(entity prey, entity pred)\r
 {\r
        // if we don't have a swallow model already, spawn one\r
        if(!prey.swallow_model)\r
@@ -245,15 +245,15 @@ void Vore_SwallowModel_Update(entity prey)
 \r
        // properties that should update whenever possible, but when the predator is available\r
        string player_swallowmodel;\r
-       player_swallowmodel = strcat(substring(self.playermodel, 0, strlen(self.playermodel) - 4), "_swallow.md3"); // 4 is the extension length\r
+       player_swallowmodel = strcat(substring(pred.playermodel, 0, strlen(pred.playermodel) - 4), "_swallow.md3"); // 4 is the extension length\r
        if(prey.swallow_model.model != player_swallowmodel) // player model can be changed while the predator is active\r
                setmodel(prey.swallow_model, player_swallowmodel);\r
-       if(prey.swallow_model.skin != self.skin) // player skin can be changed while the predator is active\r
-               prey.swallow_model.skin = self.skin;\r
+       if(prey.swallow_model.skin != pred.skin) // player skin can be changed while the predator is active\r
+               prey.swallow_model.skin = pred.skin;\r
        if(cvar("g_healthsize"))\r
-               prey.swallow_model.scale = self.scale / prey.scale; // player size difference\r
-       if(prey.swallow_model.enemy != self)\r
-               prey.swallow_model.enemy = self; // enemy is the predator\r
+               prey.swallow_model.scale = pred.scale / prey.scale; // player size difference\r
+       if(prey.swallow_model.enemy != pred)\r
+               prey.swallow_model.enemy = pred; // enemy is the predator\r
 }\r
 \r
 .entity pusher;\r
@@ -312,7 +312,7 @@ void Vore_SwallowStep(entity e)
                return;\r
        }\r
 \r
-       Vore_SwallowModel_Update(e);\r
+       Vore_SwallowModel_Update(e, self);\r
 \r
        // increase the progress value until it reaches 1, then swallow the player\r
        if(e.swallow_progress_prey < 1)\r
@@ -361,8 +361,11 @@ void Vore_Regurgitate(entity e)
        e.pushltime = time + cvar("g_maxpushtime");\r
 \r
        // regurgitated prey is given this amount of swallow progress, to simulate being more vulnerable\r
-       if(cvar("g_balance_vore_swallow_speed_fill"))\r
+       if(cvar("g_balance_vore_swallow_speed_fill") && cvar("g_balance_vore_regurgitate_swallowprogress"))\r
+       {\r
                e.swallow_progress_prey = cvar("g_balance_vore_regurgitate_swallowprogress");\r
+               Vore_SwallowModel_Update(e, e.predator);\r
+       }\r
 \r
        PlayerSound(e.predator, playersound_regurgitate, CHAN_VOICE, VOICETYPE_PLAYERSOUND);\r
        setanim(e.predator, e.predator.anim_pain1, FALSE, TRUE, TRUE); // looks good for swallowing / regurgitating\r