diff --git a/Client/game_sa/CGameSA.cpp b/Client/game_sa/CGameSA.cpp index 3dee6f1123..01770bf24c 100644 --- a/Client/game_sa/CGameSA.cpp +++ b/Client/game_sa/CGameSA.cpp @@ -1020,7 +1020,7 @@ void CGameSA::RemoveGameWorld() static_cast(m_pBuildingRemoval)->DropCaches(); - m_isBuildingsRemoved = true; + m_isGameWorldRemoved = true; } void CGameSA::RestoreGameWorld() @@ -1029,27 +1029,21 @@ void CGameSA::RestoreGameWorld() m_pPools->GetDummyPool().RestoreBackup(); m_pIplStore->SetDynamicIplStreamingEnabled(true, [](CIplSAInterface* ipl) { return memcmp("barriers", ipl->name, 8) != 0; }); - m_isBuildingsRemoved = false; + m_isGameWorldRemoved = false; } bool CGameSA::SetBuildingPoolSize(size_t size) { - const bool shouldRemoveBuilding = !m_isBuildingsRemoved; - if (shouldRemoveBuilding) - { + const bool shouldRemoveWorld = !m_isGameWorldRemoved; + if (shouldRemoveWorld) RemoveGameWorld(); - } else - { static_cast(m_pBuildingRemoval)->DropCaches(); - } bool status = m_pPools->GetBuildingsPool().Resize(size); - if (shouldRemoveBuilding) - { + if (shouldRemoveWorld) RestoreGameWorld(); - } return status; } diff --git a/Client/game_sa/CGameSA.h b/Client/game_sa/CGameSA.h index 3bdc10baf9..bbfc4b9ef1 100644 --- a/Client/game_sa/CGameSA.h +++ b/Client/game_sa/CGameSA.h @@ -372,7 +372,7 @@ class CGameSA : public CGame bool m_isBurnFlippedCarsEnabled{true}; bool m_isFireballDestructEnabled{true}; bool m_isRoadSignsTextEnabled{true}; - bool m_isBuildingsRemoved{false}; + bool m_isGameWorldRemoved{false}; bool m_isExtendedWaterCannonsEnabled{false}; static unsigned int& ClumpOffset; diff --git a/Client/game_sa/CPoolSAInterface.h b/Client/game_sa/CPoolSAInterface.h index 4ae1de8747..0416b90a34 100644 --- a/Client/game_sa/CPoolSAInterface.h +++ b/Client/game_sa/CPoolSAInterface.h @@ -114,7 +114,7 @@ class CPoolSAInterface void Delete(uint index) { Release(index); } - int Size() const noexcept { return m_nSize; }; + std::int32_t Size() const noexcept { return m_nSize; }; bool IsEmpty(std::int32_t objectIndex) const { return m_byteMap[objectIndex].bEmpty; } bool IsContains(uint index) const {