From a47858e13a6be511762d868112c5391ebd2037ce Mon Sep 17 00:00:00 2001 From: divverent Date: Thu, 27 Dec 2007 08:34:03 +0000 Subject: [PATCH] wrap skins >= numskins to 0 in Mod_Alias_GetTagIndexForName (consistent to how textures are chosen for an invlaid skin); prevents "big gun" bug in Nexuiz git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7867 d7cf8633-e32d-0410-b094-e92efae38249 --- model_alias.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/model_alias.c b/model_alias.c index b117fec3..2214583f 100644 --- a/model_alias.c +++ b/model_alias.c @@ -431,6 +431,8 @@ int Mod_Alias_GetTagMatrix(const model_t *model, int poseframe, int tagindex, ma int Mod_Alias_GetTagIndexForName(const model_t *model, unsigned int skin, const char *tagname) { int i; + if(skin >= (unsigned int)model->numskins) + skin = 0; if (model->data_overridetagnamesforskin && skin < (unsigned int)model->numskins && model->data_overridetagnamesforskin[(unsigned int)skin].num_overridetagnames) for (i = 0;i < model->data_overridetagnamesforskin[skin].num_overridetagnames;i++) if (!strcasecmp(tagname, model->data_overridetagnamesforskin[skin].data_overridetagnames[i].name)) -- 2.39.2