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,6 +280,7 @@ 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 //[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) if (actor->modelData != nullptr)
{ {
if (actor->modelData->modelIDs.Size() > modelsamount)
modelsamount = actor->modelData->modelIDs.Size(); modelsamount = actor->modelData->modelIDs.Size();
} }
@ -293,9 +294,9 @@ void RenderFrameModels(FModelRenderer *renderer, FLevelLocals *Level, const FSpr
FTextureID skinid; skinid.SetInvalid(); FTextureID skinid; skinid.SetInvalid();
surfaceskinids.Clear(); surfaceskinids.Clear();
bool surfaceskinsswapped = false;
if (actor->modelData != nullptr) if (actor->modelData != nullptr)
{ {
if (i < (int)actor->modelData->modelIDs.Size())
modelid = actor->modelData->modelIDs[i]; modelid = actor->modelData->modelIDs[i];
if (i < (int)actor->modelData->modelFrameGenerators.Size()) if (i < (int)actor->modelData->modelFrameGenerators.Size())