From 5709b2c351c6412407212e0e5346a41ea917a18a Mon Sep 17 00:00:00 2001 From: ricardoofnl Date: Thu, 3 Sep 2026 00:28:19 +0700 Subject: [PATCH] [saco] Match `CPlayerPed::PutDirectlyInVehicle`; retail tests the 0xFFFF pool sentinel before `MAX_VEHICLES` --- saco/game/playerped.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/saco/game/playerped.cpp b/saco/game/playerped.cpp index 110dfa0..8727323 100644 --- a/saco/game/playerped.cpp +++ b/saco/game/playerped.cpp @@ -823,7 +823,8 @@ void CPlayerPed::PutDirectlyInVehicle(int iVehicleID, int iSeat) if(pNetGame) { CVehiclePool* pVehiclePool = pNetGame->GetVehiclePool(); VEHICLEID TrainVehicleId = pVehiclePool->FUNC_1001EB90((int)pVehicle); - if(TrainVehicleId > MAX_VEHICLES) return; + // 0xFFFF is the vehicle pool not-found sentinel + if(TrainVehicleId == 0xFFFF || TrainVehicleId > MAX_VEHICLES) return; CVehicle* pTrain = (CVehicle *)pVehiclePool->FUNC_10001120(TrainVehicleId); if ( pTrain && pTrain->IsATrainPart() && m_pPed == GamePool_FindPlayerPed() ) {