Skip to content

Commit

Permalink
Update models_obj.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Chernoskill committed Mar 6, 2021
1 parent 27cf152 commit d1ea33a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/common/models/models_obj.cpp
Expand Up @@ -636,7 +636,7 @@ void FOBJModel::RenderFrame(FModelRenderer *renderer, FGameTexture * skin, int f
OBJSurface *surf = &surfaces[i];

FGameTexture *userSkin = skin;
if (!userSkin)
if (!userSkin && curSpriteMDLFrame)
{
int ssIndex = i + curMDLIndex * MD3_MAX_SURFACES;
if (i < MD3_MAX_SURFACES && curSpriteMDLFrame->surfaceskinIDs[ssIndex].isValid())
Expand Down Expand Up @@ -671,7 +671,7 @@ void FOBJModel::AddSkins(uint8_t* hitlist)
for (size_t i = 0; i < surfaces.Size(); i++)
{
size_t ssIndex = i + curMDLIndex * MD3_MAX_SURFACES;
if (i < MD3_MAX_SURFACES && curSpriteMDLFrame->surfaceskinIDs[ssIndex].isValid())
if (curSpriteMDLFrame && i < MD3_MAX_SURFACES && curSpriteMDLFrame->surfaceskinIDs[ssIndex].isValid())
{
// Precache skins manually reassigned by the user.
// On OBJs with lots of skins, such as Doom map OBJs exported from GZDB,
Expand Down

0 comments on commit d1ea33a

Please sign in to comment.