float Client_customizeentityforclient()\r
{\r
entity modelsource;\r
- string applymodel;\r
+ string stomachmodel;\r
\r
if(self.modelindex == 0)\r
return TRUE;\r
// now change the predator's player model into a stomach model for the prey\r
// in other words, when a player is swallowed by another player, the predator becomes an inward stomach model so the prey can see theirself in the stomach\r
// this is only visible to the prey however, otherwise players would appear as a floating stomach to everyone (ewww)\r
+ stomachmodel = strcat(substring(self.playermodel, 0, strlen(self.playermodel) - 4), "_stomach.md3"); // 4 is the extension length\r
\r
- // don't do this if we have chase_active enabled, as we'd be seeing a floating stomach from third person view\r
- if(other.cvar_chase_active > 0 || other.classname == "observer") // the classname check prevents a bug\r
- {\r
- Client_setmodel(setmodel_state());\r
- if not(self.predator.classname == "player" || self.fakeprey)\r
- self.alpha = default_player_alpha;\r
- return TRUE;\r
- }\r
if(other.spectatee_status)\r
other = other.enemy; // also do this for the player we are spectating\r
+\r
+ // don't do this if we have chase_active enabled, as we'd be seeing a floating stomach from third person view\r
+ if not(other.cvar_chase_active || other.classname == "observer") // the observer check prevents a bug\r
if(other.predator == self || other.fakepredator == self)\r
{\r
- applymodel = strcat(substring(self.playermodel, 0, strlen(self.playermodel) - 4), "_stomach.md3"); // 4 is the extension length\r
- Client_setmodel(applymodel);\r
- self.frame = 0; // don't use any animations as a stomach\r
- self.alpha = other.cvar_cl_vore_stomachmodel;\r
+ if(self.model != stomachmodel) // don't execute each frame\r
+ {\r
+ Client_setmodel(stomachmodel);\r
+ self.frame = 0; // don't use any animations as a stomach\r
+ self.alpha = other.cvar_cl_vore_stomachmodel;\r
+ }\r
return TRUE;\r
}\r
- Client_setmodel(setmodel_state());\r
- if not(self.predator.classname == "player" || self.fakeprey)\r
- self.alpha = default_player_alpha;\r
+\r
+ if(self.model != setmodel_state()) // don't execute each frame\r
+ {\r
+ Client_setmodel(setmodel_state());\r
+ if not(self.predator.classname == "player" || self.fakeprey)\r
+ self.alpha = default_player_alpha;\r
+ }\r
return TRUE;\r
}\r
\r
\r
void player_setupanimsformodel()\r
{\r
+ // if this is the stomach model (or any model that can't be animated), don't attempt to animate\r
+ if(substring(self.model, strlen(self.model) - 3, 3) == "md3") // check model extension\r
+ return;\r
+\r
local string animfilename;\r
local float animfile;\r
// defaults for legacy .zym models without animinfo files\r
}\r
else\r
dprint("File ", animfilename, " not found, assuming legacy .zym model animation timings\n");\r
+\r
+ // the line below is disabled due to issues with the stomach model, which cannot be animated.\r
+ // customizeentityforclient cannot let this part of the code know whether it's the stomach model or normal\r
+ // player model we're using. Attempting to animate the stomach model causes BIG issues, and must not be allowed.\r
+\r
+ // reset animstate now\r
+ //setanim(self, self.anim_idle, TRUE, FALSE, TRUE);\r
};\r
\r
void player_anim (void)\r
// otherwise, the stomach model the predator is transformed in (see Client_customizeentityforclient) will have a weapon model attached to it\r
if(self.owner.weaponname == "" || self.owner.deadflag != DEAD_NO)\r
return TRUE;\r
- if(other.cvar_chase_active > 0 || other.classname == "observer") // the classname check prevents a bug\r
- {\r
- setmodel(self, strcat("models/weapons/v_", self.owner.weaponname, ".md3"));\r
- return TRUE;\r
- }\r
+\r
if(other.spectatee_status)\r
other = other.enemy; // also do this for the player we are spectating\r
+\r
+ if not(other.cvar_chase_active || other.classname == "observer") // the observer check prevents a bug\r
if(other.predator == self.owner || other.fakepredator == self.owner)\r
{\r
- setmodel(self, "");\r
+ if(self.model != "") // don't execute each frame\r
+ {\r
+ setmodel(self, "");\r
+ }\r
return TRUE;\r
}\r
- setmodel(self, strcat("models/weapons/v_", self.owner.weaponname, ".md3"));\r
+\r
+ if(self.model != strcat("models/weapons/v_", self.owner.weaponname, ".md3")) // don't execute each frame\r
+ {\r
+ setmodel(self, strcat("models/weapons/v_", self.owner.weaponname, ".md3"));\r
+ }\r
return TRUE;\r
}\r
\r