From 27de95f3b352807b58bd6ff7f6053ecd8bf20b2b Mon Sep 17 00:00:00 2001 From: MirceaKitsune Date: Sun, 10 Jul 2011 02:07:47 +0300 Subject: [PATCH] Improve the last commit --- data/qcsrc/server/vore.qc | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/data/qcsrc/server/vore.qc b/data/qcsrc/server/vore.qc index 01c58f37..3e6cac56 100644 --- a/data/qcsrc/server/vore.qc +++ b/data/qcsrc/server/vore.qc @@ -236,18 +236,17 @@ void Vore_SwallowModel_Update(entity prey) prey.swallow_model.aiment = prey; prey.swallow_model.owner = prey; // owned by the prey - prey.swallow_model.enemy = self; // enemy is the predator prey.swallow_model.think = Vore_SwallowModel_Think; prey.swallow_model.nextthink = time; } - // if the model or skin of the prey's swallow model don't match those of our current predator, change them - string swallow_mdl; - swallow_mdl = strcat(substring(self.playermodel, 0, strlen(self.playermodel) - 4), "_swallow.md3"); // 4 is the extension length - if(prey.swallow_model.model != swallow_mdl) - setmodel(prey.swallow_model, swallow_mdl); - if(prey.swallow_model.skin != self.skin) + // if predator has changed, update the swallow model + if(prey.swallow_model.enemy != self) + { + setmodel(prey.swallow_model, strcat(substring(self.playermodel, 0, strlen(self.playermodel) - 4), "_swallow.md3")); // 4 is the extension length prey.swallow_model.skin = self.skin; + prey.swallow_model.enemy = self; // enemy is the predator + } } .entity pusher; -- 2.39.2