diff --git a/Client/game_sa/CGameSA.cpp b/Client/game_sa/CGameSA.cpp index e4029c7ecd..9a80012eb2 100644 --- a/Client/game_sa/CGameSA.cpp +++ b/Client/game_sa/CGameSA.cpp @@ -909,6 +909,7 @@ void CGameSA::RemoveAllBuildings() m_pPools->GetDummyPool().RemoveAllBuildingLods(); m_pPools->GetBuildingsPool().RemoveAllBuildings(); + m_isBuildingsRemoved = true; } void CGameSA::RestoreGameBuildings() @@ -917,15 +918,23 @@ void CGameSA::RestoreGameBuildings() m_pPools->GetDummyPool().RestoreAllBuildingsLods(); m_pIplStore->SetDynamicIplStreamingEnabled(true, [](CIplSAInterface* ipl) { return memcmp("barriers", ipl->name, 8) != 0; }); + m_isBuildingsRemoved = false; } bool CGameSA::SetBuildingPoolSize(size_t size) { - RemoveAllBuildings(); + const bool shouldRemoveBuilding = !m_isBuildingsRemoved; + if (shouldRemoveBuilding) + { + RemoveAllBuildings(); + } bool status = m_pPools->GetBuildingsPool().Resize(size); - RestoreGameBuildings(); + if (shouldRemoveBuilding) + { + RestoreGameBuildings(); + } return status; } diff --git a/Client/game_sa/CGameSA.h b/Client/game_sa/CGameSA.h index c668276656..df8a2e5b79 100644 --- a/Client/game_sa/CGameSA.h +++ b/Client/game_sa/CGameSA.h @@ -348,6 +348,7 @@ class CGameSA : public CGame bool m_isBurnFlippedCarsEnabled{true}; bool m_isFireballDestructEnabled{true}; bool m_isRoadSignsTextEnabled{true}; + bool m_isBuildingsRemoved{false}; static unsigned int& ClumpOffset;