fixed bug which caused all models to be untextured if they used internal skins
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 30 Aug 2002 02:20:42 +0000 (02:20 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 30 Aug 2002 02:20:42 +0000 (02:20 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@2313 d7cf8633-e32d-0410-b094-e92efae38249

model_alias.c

index 6e76554..c62cb9c 100644 (file)
@@ -224,12 +224,12 @@ static int Mod_LoadExternalSkin (char *basename, skinframe_t *skinframe, int pre
        skinframe->shirt  = loadtextureimage(loadmodel->texturepool, va("%s_shirt" , basename), 0, 0, false, r_mipskins.integer, precache);
        skinframe->glow   = loadtextureimage(loadmodel->texturepool, va("%s_glow"  , basename), 0, 0, false, r_mipskins.integer, precache);
        skinframe->merged = NULL;
-       return skinframe->base != NULL || skinframe->pants != NULL || skinframe->shirt != NULL || skinframe->glow != NULL || skinframe->merged != NULL || skinframe->fog != NULL;
+       return skinframe->base != NULL || skinframe->pants != NULL || skinframe->shirt != NULL || skinframe->glow != NULL;
 }
 
 static int Mod_LoadInternalSkin (char *basename, qbyte *skindata, qbyte *skintemp, int width, int height, skinframe_t *skinframe, int precache)
 {
-       if (skindata && skintemp)
+       if (!skindata || !skintemp)
                return false;
        skinframe->pants  = GL_SkinSplitShirt(skindata, skintemp, width, height, 0x0040, va("%s_pants", basename), false); // pants
        skinframe->shirt  = GL_SkinSplitShirt(skindata, skintemp, width, height, 0x0002, va("%s_shirt", basename), false); // shirt