Skip to content

Commit

Permalink
Fix review
Browse files Browse the repository at this point in the history
  • Loading branch information
TheNormalnij committed Jun 15, 2024
1 parent 6842c94 commit fa852c6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Client/game_sa/CBuildingsPoolSA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ inline bool CBuildingsPoolSA::AddBuildingToPool(CClientBuilding* pClientBuilding
m_buildingPool.entities[dwElementIndexInPool] = {pBuilding, (CClientEntity*)pClientBuilding};

// Increase the count of objects
++m_buildingPool.ulCount;
++m_buildingPool.count;

return true;
}
Expand Down Expand Up @@ -118,7 +118,7 @@ void CBuildingsPoolSA::RemoveBuilding(CBuilding* pBuilding)
(*m_ppBuildingPoolInterface)->Release(dwElementIndexInPool);

// Decrease the count of elements in the pool
--m_buildingPool.ulCount;
--m_buildingPool.count;
}

void CBuildingsPoolSA::RemoveAllBuildings()
Expand Down
2 changes: 1 addition & 1 deletion Client/game_sa/CBuildingsPoolSA.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class CBuildingsPoolSA : public CBuildingsPool
void RemovePedsContactEnityLinks();

private:
SVectorPoolData<CBuildingSA, CBuildingSAInterface> m_buildingPool{MAX_BUILDINGS};
SVectorPoolData<CBuildingSA> m_buildingPool{MAX_BUILDINGS};
CPoolSAInterface<CBuildingSAInterface>** m_ppBuildingPoolInterface;

std::unique_ptr<std::array<std::pair<bool, CBuildingSAInterface>, MAX_BUILDINGS>> m_pOriginalBuildingsBackup;
Expand Down
6 changes: 3 additions & 3 deletions Client/game_sa/CPoolSAInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,14 @@ struct SPoolData
}
};

template <class T, class I>
template <class T>
struct SVectorPoolData
{
std::vector<SClientEntity<T>> entities;
unsigned long ulCount;
size_t count;

public:
SVectorPoolData(size_t defaultSize) : ulCount(0UL)
SVectorPoolData(size_t defaultSize) : count(0)
{
entities.resize(defaultSize, {nullptr, nullptr});
}
Expand Down

0 comments on commit fa852c6

Please sign in to comment.