Skip to content

Fix model types to CHandlingManager #4068

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
12 changes: 6 additions & 6 deletions Server/mods/deathmatch/logic/CHandlingManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ static tHandlingData m_OriginalHandlingData[HT_MAX];
static std::unique_ptr<CHandlingEntry> m_OriginalEntries[HT_MAX];

// Model handling data
static std::unordered_map<std::size_t, std::unique_ptr<CHandlingEntry>> m_ModelEntries;
static std::unordered_map<std::size_t, bool> m_bModelHandlingChanged;
static std::unordered_map<std::uint32_t, std::unique_ptr<CHandlingEntry>> m_ModelEntries;
static std::unordered_map<std::uint32_t, bool> m_ModelHandlingChanged;

static std::map<std::string, eHandlingProperty> m_HandlingNames;

Expand Down Expand Up @@ -142,21 +142,21 @@ bool CHandlingManager::HasModelHandlingChanged(std::uint32_t model) const noexce
return false;

// Return if we have changed
return m_bModelHandlingChanged[model];
return m_ModelHandlingChanged[model];
}

void CHandlingManager::SetModelHandlingHasChanged(std::uint32_t model, bool bChanged) const noexcept
void CHandlingManager::SetModelHandlingHasChanged(std::uint32_t model, bool changed) const noexcept
{
// Within range?
if (!CVehicleManager::IsValidModel(model))
return;

// Return if we have changed.
m_bModelHandlingChanged[model] = bChanged;
m_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)
{
Expand Down
4 changes: 2 additions & 2 deletions Server/mods/deathmatch/logic/CHandlingManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
void SetModelHandlingHasChanged(std::uint32_t model, bool changed) const noexcept;

private:
void InitializeDefaultHandlings() noexcept;
Expand Down
Loading