Skip to content

Commit

Permalink
Use offset argument
Browse files Browse the repository at this point in the history
  • Loading branch information
TheNormalnij committed Aug 21, 2024
1 parent 78d32b6 commit 91a22d0
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Client/game_sa/CBuildingsPoolSA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ bool CBuildingsPoolSA::Resize(int size)
newBytemap[i].bEmpty = true;
}

const uint32_t offset = (uint32_t)newObjects - (uint32_t)oldPool;
const std::uint32_t offset = (std::uint32_t)newObjects - (std::uint32_t)oldPool;
if (oldPool != nullptr)
{
UpdateIplEntrysPointers(offset);
Expand All @@ -235,7 +235,7 @@ bool CBuildingsPoolSA::Resize(int size)
UpdateBackupLodPointers(offset);
}

pGame->GetPools()->GetDummyPool().UpdateBuildingLods(oldPool, newObjects);
pGame->GetPools()->GetDummyPool().UpdateBuildingLods(offset);

RemoveVehicleDamageLinks();
RemovePedsContactEnityLinks();
Expand Down
4 changes: 1 addition & 3 deletions Client/game_sa/CDummyPoolSA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,8 @@ void CDummyPoolSA::RestoreBackup()
m_pOriginalElementsBackup = nullptr;
}

void CDummyPoolSA::UpdateBuildingLods(void* oldPool, void* newPool)
void CDummyPoolSA::UpdateBuildingLods(const std::uint32_t offset)
{
const std::uint32_t offset = (std::uint32_t)newPool - (std::uint32_t)oldPool;

if (m_pOriginalElementsBackup)
UpdateBackupLodOffset(offset);
else
Expand Down
2 changes: 1 addition & 1 deletion Client/game_sa/CDummyPoolSA.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class CDummyPoolSA final : public CDummyPool

void RemoveAllWithBackup() override;
void RestoreBackup() override;
void UpdateBuildingLods(void* oldPool, void* newPool);
void UpdateBuildingLods(const std::uint32_t offset);

private:
void UpdateBackupLodOffset(const std::uint32_t offest);
Expand Down
2 changes: 1 addition & 1 deletion Client/sdk/game/CDummyPool.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ class CDummyPool
public:
virtual void RemoveAllWithBackup() = 0;
virtual void RestoreBackup() = 0;
virtual void UpdateBuildingLods(void* oldPool, void* newPool) = 0;
virtual void UpdateBuildingLods(const std::uint32_t offset) = 0;
};

0 comments on commit 91a22d0

Please sign in to comment.