diff --git a/Server/mods/deathmatch/logic/CHandlingManager.cpp b/Server/mods/deathmatch/logic/CHandlingManager.cpp index 7776c55af05..2209a332baf 100644 --- a/Server/mods/deathmatch/logic/CHandlingManager.cpp +++ b/Server/mods/deathmatch/logic/CHandlingManager.cpp @@ -19,8 +19,8 @@ static tHandlingData m_OriginalHandlingData[HT_MAX]; static std::unique_ptr m_OriginalEntries[HT_MAX]; // Model handling data -static std::unordered_map> m_ModelEntries; -static std::unordered_map m_bModelHandlingChanged; +static std::unordered_map> m_ModelEntries; +static std::unordered_map g_ModelHandlingChanged; static std::map m_HandlingNames; @@ -135,28 +135,28 @@ eHandlingProperty CHandlingManager::GetPropertyEnumFromName(const std::string& n return it != m_HandlingNames.end() ? it->second : HANDLING_MAX; } -bool CHandlingManager::HasModelHandlingChanged(std::uint32_t model) const noexcept +bool CHandlingManager::HasModelHandlingChanged(std::uint32_t model) noexcept { // Within range? if (!CVehicleManager::IsValidModel(model)) return false; // Return if we have changed - return m_bModelHandlingChanged[model]; + return g_ModelHandlingChanged[model]; } -void CHandlingManager::SetModelHandlingHasChanged(std::uint32_t model, bool bChanged) const noexcept +void CHandlingManager::SetModelHandlingHasChanged(std::uint32_t model, bool changed) noexcept { // Within range? if (!CVehicleManager::IsValidModel(model)) return; // Return if we have changed. - m_bModelHandlingChanged[model] = bChanged; + g_ModelHandlingChanged[model] = changed; } // Return the handling manager id -eHandlingTypes CHandlingManager::GetHandlingID(std::uint32_t model) const noexcept +eHandlingTypes CHandlingManager::GetHandlingID(std::uint32_t model) noexcept { switch (model) { diff --git a/Server/mods/deathmatch/logic/CHandlingManager.h b/Server/mods/deathmatch/logic/CHandlingManager.h index bd0e2f0aa67..fd47c55f728 100644 --- a/Server/mods/deathmatch/logic/CHandlingManager.h +++ b/Server/mods/deathmatch/logic/CHandlingManager.h @@ -29,12 +29,12 @@ class CHandlingManager const CHandlingEntry* GetOriginalHandlingData(std::uint32_t model) const noexcept; CHandlingEntry* GetModelHandlingData(std::uint32_t model) const noexcept; - eHandlingTypes GetHandlingID(std::uint32_t model) const noexcept; + static eHandlingTypes GetHandlingID(std::uint32_t model) noexcept; // Helper functions eHandlingProperty GetPropertyEnumFromName(const std::string& name) const noexcept; - bool HasModelHandlingChanged(std::uint32_t model) const noexcept; - void SetModelHandlingHasChanged(std::uint32_t model, bool bChanged) const noexcept; + static bool HasModelHandlingChanged(std::uint32_t model) noexcept; + static void SetModelHandlingHasChanged(std::uint32_t model, bool changed) noexcept; private: void InitializeDefaultHandlings() noexcept; diff --git a/Server/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp b/Server/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp index 85963144ab9..9da6375d228 100644 --- a/Server/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp +++ b/Server/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp @@ -5651,7 +5651,7 @@ bool CStaticFunctionDefinitions::SetModelHandling(std::uint32_t model, eHandling if (!SetEntryHandling(pEntry, eProperty, fValue)) return false; - m_pHandlingManager->SetModelHandlingHasChanged(model, true); + CHandlingManager::SetModelHandlingHasChanged(model, true); return true; } @@ -5664,7 +5664,7 @@ bool CStaticFunctionDefinitions::SetModelHandling(std::uint32_t model, eHandling if (!SetEntryHandling(pEntry, eProperty, vecValue)) return false; - m_pHandlingManager->SetModelHandlingHasChanged(model, true); + CHandlingManager::SetModelHandlingHasChanged(model, true); return true; } @@ -5677,7 +5677,7 @@ bool CStaticFunctionDefinitions::SetModelHandling(std::uint32_t model, eHandling if (!SetEntryHandling(pEntry, eProperty, strValue)) return false; - m_pHandlingManager->SetModelHandlingHasChanged(model, true); + CHandlingManager::SetModelHandlingHasChanged(model, true); return true; } @@ -5690,7 +5690,7 @@ bool CStaticFunctionDefinitions::SetModelHandling(std::uint32_t model, eHandling if (!SetEntryHandling(pEntry, eProperty, ucValue)) return false; - m_pHandlingManager->SetModelHandlingHasChanged(model, true); + CHandlingManager::SetModelHandlingHasChanged(model, true); return true; } @@ -5703,7 +5703,7 @@ bool CStaticFunctionDefinitions::SetModelHandling(std::uint32_t model, eHandling if (!SetEntryHandling(pEntry, eProperty, uiValue)) return false; - m_pHandlingManager->SetModelHandlingHasChanged(model, true); + CHandlingManager::SetModelHandlingHasChanged(model, true); return true; } diff --git a/Server/mods/deathmatch/logic/packets/CEntityAddPacket.cpp b/Server/mods/deathmatch/logic/packets/CEntityAddPacket.cpp index c41c17ebccd..3b285dd00de 100644 --- a/Server/mods/deathmatch/logic/packets/CEntityAddPacket.cpp +++ b/Server/mods/deathmatch/logic/packets/CEntityAddPacket.cpp @@ -612,7 +612,7 @@ bool CEntityAddPacket::Write(NetBitStreamInterface& BitStream) const BitStream.WriteBit(false); // Write handling - if (g_pGame->GetHandlingManager()->HasModelHandlingChanged(pVehicle->GetModel()) || pVehicle->HasHandlingChanged()) + if (CHandlingManager::HasModelHandlingChanged(pVehicle->GetModel()) || pVehicle->HasHandlingChanged()) { BitStream.WriteBit(true); SVehicleHandlingSync handling;