From a59b8ad939ccf9441cfe3f44a2f399a77762ba01 Mon Sep 17 00:00:00 2001 From: FileEX Date: Wed, 9 Oct 2024 22:22:36 +0200 Subject: [PATCH] Fix --- Client/mods/deathmatch/logic/CClientPed.cpp | 4 ++++ Client/mods/deathmatch/logic/CClientVehicle.cpp | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Client/mods/deathmatch/logic/CClientPed.cpp b/Client/mods/deathmatch/logic/CClientPed.cpp index 5716bea120f..28f4d4f94a9 100644 --- a/Client/mods/deathmatch/logic/CClientPed.cpp +++ b/Client/mods/deathmatch/logic/CClientPed.cpp @@ -1394,6 +1394,10 @@ void CClientPed::WarpIntoVehicle(CClientVehicle* pVehicle, unsigned int uiSeat) } } + // Wrong seat or undefined passengers count? + if ((uiSeat > 0 && uiSeat > pVehicle->m_ucMaxPassengers) || (uiSeat > 0 && pVehicle->m_ucMaxPassengers == 255)) + return; + // Transfer WaitingForGroundToLoad state to vehicle if (m_bIsLocalPlayer) { diff --git a/Client/mods/deathmatch/logic/CClientVehicle.cpp b/Client/mods/deathmatch/logic/CClientVehicle.cpp index a45d850a30a..537f9457dd0 100644 --- a/Client/mods/deathmatch/logic/CClientVehicle.cpp +++ b/Client/mods/deathmatch/logic/CClientVehicle.cpp @@ -2656,7 +2656,12 @@ void CClientVehicle::Create() { if (m_pPassengers[i]) { - m_pPassengers[i]->WarpIntoVehicle(this, i + 1); + // Undefined passengers count? + if (m_ucMaxPassengers != 255) + m_pPassengers[i]->WarpIntoVehicle(this, i + 1); + else + m_pPassengers[i]->SetWarpInToVehicleRequired(false); + if (m_pPassengers[i]) m_pPassengers[i]->StreamIn(true); }