]> de.git.xonotic.org Git - voretournament/voretournament.git/commitdiff
Improve the last commit
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 9 Jul 2011 23:07:47 +0000 (02:07 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 9 Jul 2011 23:07:47 +0000 (02:07 +0300)
data/qcsrc/server/vore.qc

index 01c58f3704a90593f6dcecfeb29a3cf136ff2ded..3e6cac564d9c809e00d03b31fe75fad7d86d2e87 100644 (file)
@@ -236,18 +236,17 @@ void Vore_SwallowModel_Update(entity prey)
                prey.swallow_model.aiment = prey;\r
 \r
                prey.swallow_model.owner = prey; // owned by the prey\r
-               prey.swallow_model.enemy = self; // enemy is the predator\r
                prey.swallow_model.think = Vore_SwallowModel_Think;\r
                prey.swallow_model.nextthink = time;\r
        }\r
 \r
-       // if the model or skin of the prey's swallow model don't match those of our current predator, change them\r
-       string swallow_mdl;\r
-       swallow_mdl = strcat(substring(self.playermodel, 0, strlen(self.playermodel) - 4), "_swallow.md3"); // 4 is the extension length\r
-       if(prey.swallow_model.model != swallow_mdl)\r
-               setmodel(prey.swallow_model, swallow_mdl);\r
-       if(prey.swallow_model.skin != self.skin)\r
+       // if predator has changed, update the swallow model\r
+       if(prey.swallow_model.enemy != self)\r
+       {\r
+               setmodel(prey.swallow_model, strcat(substring(self.playermodel, 0, strlen(self.playermodel) - 4), "_swallow.md3")); // 4 is the extension length\r
                prey.swallow_model.skin = self.skin;\r
+               prey.swallow_model.enemy = self; // enemy is the predator\r
+       }\r
 }\r
 \r
 .entity pusher;\r