Fix NaN in LoadSkin

This commit is contained in:
Jupeyy 2020-10-17 17:59:18 +02:00
parent b93896b37c
commit 331249ed89

View file

@ -97,8 +97,10 @@ int CSkins::LoadSkin(const char *pName, const char *pPath, int DirType, int *pGe
aColors[2] += d[y * Pitch + x * 4 + 2];
}
}
Skin.m_BloodColor = ColorRGBA(normalize(vec3(aColors[0], aColors[1], aColors[2])));
if(aColors[0] != 0 && aColors[1] != 0 && aColors[2] != 0)
Skin.m_BloodColor = ColorRGBA(normalize(vec3(aColors[0], aColors[1], aColors[2])));
else
Skin.m_BloodColor = ColorRGBA(0, 0, 0, 1);
}
// create colorless version