From: divverent Date: Thu, 27 Dec 2007 08:34:03 +0000 (+0000) Subject: wrap skins >= numskins to 0 in Mod_Alias_GetTagIndexForName (consistent to how textur... X-Git-Tag: xonotic-v0.1.0preview~2624 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a47858e13a6be511762d868112c5391ebd2037ce;p=xonotic%2Fdarkplaces.git 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 --- 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))