Skip to content

Commit

Permalink
Update models.cpp
Browse files Browse the repository at this point in the history
- Removed a useless bool
- Fixed an issue with model containers having less models than their smf total models amount using the smaller amount
  • Loading branch information
ShinyMetagross authored and coelckers committed Jul 27, 2022
1 parent e2778ba commit 83077b6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/r_data/models.cpp
Expand Up @@ -280,7 +280,8 @@ void RenderFrameModels(FModelRenderer *renderer, FLevelLocals *Level, const FSpr
//[SM] - if we added any models for the frame to also render, then we also need to update modelsAmount for this smf
if (actor->modelData != nullptr)
{
modelsamount = actor->modelData->modelIDs.Size();
if (actor->modelData->modelIDs.Size() > modelsamount)
modelsamount = actor->modelData->modelIDs.Size();
}

TArray<FTextureID> surfaceskinids;
Expand All @@ -293,10 +294,10 @@ void RenderFrameModels(FModelRenderer *renderer, FLevelLocals *Level, const FSpr
FTextureID skinid; skinid.SetInvalid();

surfaceskinids.Clear();
bool surfaceskinsswapped = false;
if (actor->modelData != nullptr)
{
modelid = actor->modelData->modelIDs[i];
if (i < (int)actor->modelData->modelIDs.Size())
modelid = actor->modelData->modelIDs[i];

if (i < (int)actor->modelData->modelFrameGenerators.Size())
{
Expand Down

0 comments on commit 83077b6

Please sign in to comment.