From: MirceaKitsune Date: Sat, 9 Jul 2011 23:07:47 +0000 (+0300) Subject: Improve the last commit X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=27de95f3b352807b58bd6ff7f6053ecd8bf20b2b;p=voretournament%2Fvoretournament.git Improve the last commit --- 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;