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 9157339
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions Client/mods/deathmatch/logic/CClientBuildingManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,24 @@ 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();
}
}
}

}

void CClientBuildingManager::ResizePoolIfNeeds()
Expand Down

0 comments on commit 9157339

Please sign in to comment.