From f40677c7a4f12306c202bad8966bb19d993422ad Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Tue, 26 May 2020 16:17:40 +0300 Subject: [PATCH] fixed crash --- src/vehicles/Vehicle.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vehicles/Vehicle.cpp b/src/vehicles/Vehicle.cpp index a6f8719e..1dc7af11 100644 --- a/src/vehicles/Vehicle.cpp +++ b/src/vehicles/Vehicle.cpp @@ -1757,13 +1757,13 @@ CVehicle::SetupPassenger(int n) if(passenger->m_nPedType == PEDTYPE_CIVMALE || passenger->m_nPedType == PEDTYPE_CIVFEMALE) for(i = 0; i < n; i++) if(pPassengers[i] && pPassengers[n] && - pPassengers[i]->m_nPedType == PEDTYPE_CIVMALE || pPassengers[i]->m_nPedType == PEDTYPE_CIVFEMALE && + (pPassengers[i]->m_nPedType == PEDTYPE_CIVMALE || pPassengers[i]->m_nPedType == PEDTYPE_CIVFEMALE) && passenger->GetModelIndex() == pPassengers[i]->GetModelIndex()){ pPassengers[n] = nil; CPopulation::RemovePed(passenger); } } - if(bIsBus) + if(bIsBus && pPassengers[n]) pPassengers[n]->bRenderPedInCar = false; ++m_nNumPassengers; return pPassengers[n];