From 91a22d0881a9c991d28c08ca369fa22d4508c15d Mon Sep 17 00:00:00 2001 From: Uladzislau Nikalayevich Date: Wed, 21 Aug 2024 22:09:32 +0300 Subject: [PATCH] Use offset argument --- Client/game_sa/CBuildingsPoolSA.cpp | 4 ++-- Client/game_sa/CDummyPoolSA.cpp | 4 +--- Client/game_sa/CDummyPoolSA.h | 2 +- Client/sdk/game/CDummyPool.h | 2 +- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Client/game_sa/CBuildingsPoolSA.cpp b/Client/game_sa/CBuildingsPoolSA.cpp index 2b55e4c92d..7f4f05f181 100644 --- a/Client/game_sa/CBuildingsPoolSA.cpp +++ b/Client/game_sa/CBuildingsPoolSA.cpp @@ -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); @@ -235,7 +235,7 @@ bool CBuildingsPoolSA::Resize(int size) UpdateBackupLodPointers(offset); } - pGame->GetPools()->GetDummyPool().UpdateBuildingLods(oldPool, newObjects); + pGame->GetPools()->GetDummyPool().UpdateBuildingLods(offset); RemoveVehicleDamageLinks(); RemovePedsContactEnityLinks(); diff --git a/Client/game_sa/CDummyPoolSA.cpp b/Client/game_sa/CDummyPoolSA.cpp index 1b7bf87d65..5a85061f10 100644 --- a/Client/game_sa/CDummyPoolSA.cpp +++ b/Client/game_sa/CDummyPoolSA.cpp @@ -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 diff --git a/Client/game_sa/CDummyPoolSA.h b/Client/game_sa/CDummyPoolSA.h index 1e65676cf7..8f42d98c7c 100644 --- a/Client/game_sa/CDummyPoolSA.h +++ b/Client/game_sa/CDummyPoolSA.h @@ -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); diff --git a/Client/sdk/game/CDummyPool.h b/Client/sdk/game/CDummyPool.h index 793ae3d6f5..08ca6f7256 100644 --- a/Client/sdk/game/CDummyPool.h +++ b/Client/sdk/game/CDummyPool.h @@ -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; };