Skip to content

Commit

Permalink
Small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
TheNormalnij committed Aug 4, 2024
1 parent aeecd9e commit a20dd15
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
16 changes: 5 additions & 11 deletions Client/game_sa/CGameSA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1020,7 +1020,7 @@ void CGameSA::RemoveGameWorld()

static_cast<CBuildingRemovalSA*>(m_pBuildingRemoval)->DropCaches();

m_isBuildingsRemoved = true;
m_isGameWorldRemoved = true;
}

void CGameSA::RestoreGameWorld()
Expand All @@ -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<CBuildingRemovalSA*>(m_pBuildingRemoval)->DropCaches();
}

bool status = m_pPools->GetBuildingsPool().Resize(size);

if (shouldRemoveBuilding)
{
if (shouldRemoveWorld)
RestoreGameWorld();
}

return status;
}
Expand Down
2 changes: 1 addition & 1 deletion Client/game_sa/CGameSA.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Client/game_sa/CPoolSAInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down

0 comments on commit a20dd15

Please sign in to comment.