Update models.cpp

- Removed a useless bool
- Fixed an issue with model containers having less models than their smf total models amount using the smaller amount
This commit is contained in:
Shiny Metagross 2022-07-26 17:19:35 -07:00 committed by Christoph Oelckers
parent e2778ba442
commit 83077b6f95

View file

@ -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;
@ -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())
{