From d370c2076d818817086056af36fb93548bc46635 Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Sun, 1 Nov 2020 09:20:37 +0200 Subject: [PATCH 1/2] Fix virtual SetModelIndex call in CBoat ctor --- src/vehicles/Boat.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vehicles/Boat.cpp b/src/vehicles/Boat.cpp index 8b5de929..26774cad 100644 --- a/src/vehicles/Boat.cpp +++ b/src/vehicles/Boat.cpp @@ -60,7 +60,7 @@ CBoat::CBoat(int mi, uint8 owner) : CVehicle(owner) m_fMovingSpeed = 0.0f; m_skimmerThingTimer = 0.0f; m_nPoliceShoutTimer = CTimer::GetTimeInMilliseconds(); - SetModelIndex(mi); + CBoat::SetModelIndex(mi); pHandling = mod_HandlingManager.GetHandlingData((eHandlingId)minfo->m_handlingId); pFlyingHandling = mod_HandlingManager.GetFlyingPointer((eHandlingId)minfo->m_handlingId); From 20ea2fde84236c21a9afa21265928502f7cd98d8 Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Sun, 1 Nov 2020 09:46:02 +0200 Subject: [PATCH 2/2] Also fix SetModelIndex in CAutomobile and CTrain ctors --- src/vehicles/Automobile.cpp | 2 +- src/vehicles/Train.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vehicles/Automobile.cpp b/src/vehicles/Automobile.cpp index d1a7505e..77a7467a 100644 --- a/src/vehicles/Automobile.cpp +++ b/src/vehicles/Automobile.cpp @@ -79,7 +79,7 @@ CAutomobile::CAutomobile(int32 id, uint8 CreatedBy) bBigWheels = false; bWaterTight = false; - SetModelIndex(id); + CAutomobile::SetModelIndex(id); // Already done in CVehicle... switch(GetModelIndex()){ diff --git a/src/vehicles/Train.cpp b/src/vehicles/Train.cpp index fb8361c5..9f30cfb7 100644 --- a/src/vehicles/Train.cpp +++ b/src/vehicles/Train.cpp @@ -45,7 +45,7 @@ CTrain::CTrain(int32 id, uint8 CreatedBy) CVehicleModelInfo *mi = (CVehicleModelInfo*)CModelInfo::GetModelInfo(id); m_vehType = VEHICLE_TYPE_TRAIN; pHandling = mod_HandlingManager.GetHandlingData((eHandlingId)mi->m_handlingId); - SetModelIndex(id); + CTrain::SetModelIndex(id); Doors[0].Init(0.8f, 0.0f, 1, 0); Doors[1].Init(-0.8f, 0.0f, 0, 0);