Skip to content

Commit

Permalink
Fix crash CHandlingManager.cpp (#3101)
Browse files Browse the repository at this point in the history
  • Loading branch information
Olya-Marinova committed Jul 4, 2023
1 parent fff6201 commit b6867a0
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Server/mods/deathmatch/logic/CHandlingManager.cpp
Expand Up @@ -12,6 +12,7 @@
#include "StdInc.h"
#include "CHandlingManager.h"
#include "CCommon.h"
#include "CVehicleManager.h"

SFixedArray<tHandlingData, HT_MAX> CHandlingManager::m_OriginalHandlingData;

Expand Down Expand Up @@ -99,7 +100,7 @@ CHandlingEntry* CHandlingManager::CreateHandlingData()
bool CHandlingManager::ApplyHandlingData(eVehicleTypes eModel, CHandlingEntry* pEntry)
{
// Within range?
if (eModel >= 400 && eModel < VT_MAX)
if (CVehicleManager::IsValidModel(eModel))
{
// Get our Handling ID
eHandlingTypes eHandling = GetHandlingID(eModel);
Expand All @@ -115,7 +116,7 @@ bool CHandlingManager::ApplyHandlingData(eVehicleTypes eModel, CHandlingEntry* p
const CHandlingEntry* CHandlingManager::GetOriginalHandlingData(eVehicleTypes eModel)
{
// Within range?
if (eModel >= 400 && eModel < VT_MAX)
if (CVehicleManager::IsValidModel(eModel))
{
// Get our Handling ID
eHandlingTypes eHandling = GetHandlingID(eModel);
Expand All @@ -129,7 +130,7 @@ const CHandlingEntry* CHandlingManager::GetOriginalHandlingData(eVehicleTypes eM
const CHandlingEntry* CHandlingManager::GetModelHandlingData(eVehicleTypes eModel)
{
// Within range?
if (eModel >= 400 && eModel < VT_MAX)
if (CVehicleManager::IsValidModel(eModel))
{
// Get our Handling ID
eHandlingTypes eHandling = GetHandlingID(eModel);
Expand All @@ -156,7 +157,7 @@ eHandlingProperty CHandlingManager::GetPropertyEnumFromName(std::string strName)
bool CHandlingManager::HasModelHandlingChanged(eVehicleTypes eModel)
{
// Within range?
if (eModel >= 400 && eModel < VT_MAX)
if (CVehicleManager::IsValidModel(eModel))
{
// Get our Handling ID
eHandlingTypes eHandling = GetHandlingID(eModel);
Expand Down

0 comments on commit b6867a0

Please sign in to comment.