Skip to content

Commit

Permalink
Fix LODs crash
Browse files Browse the repository at this point in the history
  • Loading branch information
TheNormalnij committed Jun 26, 2024
1 parent 7b228da commit 356243c
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions Client/mods/deathmatch/logic/CClientBuildingManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,22 @@ void CClientBuildingManager::DestroyAllForABit()

void CClientBuildingManager::RestoreDestroyed()
{
for (CClientBuilding* building : GetBuildings())
bool hasInvalidLods = true;
while (hasInvalidLods)
{
building->Create();
hasInvalidLods = false;
for (CClientBuilding* building : GetBuildings())
{
const CClientBuilding* highLodBuilding = building->GetHighLodBuilding();
if (highLodBuilding && !highLodBuilding->IsValid())
{
hasInvalidLods = true;
}
else
{
building->Create();
}
}
}
}

Expand Down

0 comments on commit 356243c

Please sign in to comment.