Fixed silent crash if several Lara objects are present in level near dynamic light with shadow

This commit is contained in:
Lwmte 2024-12-24 00:52:32 +01:00
parent 12dae8df99
commit 9fbcc7b8cf

View file

@ -209,6 +209,12 @@ namespace TEN::Renderer
for (int k = 0; k < obj.ObjectMeshes.size(); k++)
{
if (item->MeshIds.size() <= k)
{
TENLog("Mesh structure was not properly initialized for object " + GetObjectName((GAME_OBJECT_ID)item->ObjectID));
break;
}
auto* mesh = GetMesh(item->MeshIds[k]);
for (auto& bucket : mesh->Buckets)