From c2a7c3ad172cd5ff01664ac8eb73d434ba6cd5bb Mon Sep 17 00:00:00 2001 From: ricardoofnl Date: Fri, 4 Sep 2026 22:26:59 +0700 Subject: [PATCH] [saco] Match `CLocalPlayer::FUNC_10005BF0`; the guards must nest, sequential `return`s each emit their own `BitStream` dtor --- saco/game/camera.h | 1 + saco/game/playerped.h | 1 + saco/game/vehicle.h | 3 +++ saco/net/localplayer.cpp | 29 +++++++++++++++++++++++++++++ 4 files changed, 34 insertions(+) diff --git a/saco/game/camera.h b/saco/game/camera.h index ae0d7d1..607853e 100644 --- a/saco/game/camera.h +++ b/saco/game/camera.h @@ -23,6 +23,7 @@ public: void InterpolateLookAt(VECTOR *vecFrom, VECTOR *vecTo, int iTime, BYTE byteCut); void FUNC_1009D660(CEntity *pEntity); void FUNC_1009D6B0(); + void FUNC_1009D740(); // .text:1009D740 float GetDistanceFromPoint(VECTOR *vecPos); CCamera() { diff --git a/saco/game/playerped.h b/saco/game/playerped.h index e3d477e..1df60d9 100644 --- a/saco/game/playerped.h +++ b/saco/game/playerped.h @@ -124,6 +124,7 @@ public: ~CPlayerPed(); int sub_100ADFA0(); // .text:100ADFA0 + BOOL FUNC_100ABFC0(); // .text:100ABFC0 void FUNC_100ADFB0(int iLevel); // .text:100ADFB0 int FUNC_100ADC90(); // .text:100ADC90 diff --git a/saco/game/vehicle.h b/saco/game/vehicle.h index 9bb0863..c16c176 100644 --- a/saco/game/vehicle.h +++ b/saco/game/vehicle.h @@ -87,6 +87,9 @@ public: void FUNC_100B81A0(); // .text:100B81A0 void FUNC_100B81F0(); // .text:100B81F0 + BOOL FUNC_100B7460(); // .text:100B7460 + BOOL FUNC_100B7E00(); // .text:100B7E00 + }; diff --git a/saco/net/localplayer.cpp b/saco/net/localplayer.cpp index ea3c1d3..45cd873 100644 --- a/saco/net/localplayer.cpp +++ b/saco/net/localplayer.cpp @@ -228,3 +228,32 @@ void CLocalPlayer::SelectPreviousClass() pGame->m_pGameAudio->PlaySound(1053, mat.pos.X, mat.pos.Y, mat.pos.Z); RequestClass(field_2FE); } + +//---------------------------------------------------- + +// leaving a vehicle; every guard shares one exit so the nesting has to stay +void CLocalPlayer::FUNC_10005BF0(WORD a1) +{ + RakNet::BitStream bsSend; + + CVehiclePool *pVehiclePool = pNetGame->GetVehiclePool(); + + if(a1 < MAX_VEHICLES && pVehiclePool->field_3074[a1]) + { + int pVehicle = pVehiclePool->field_1134[a1]; + if(pVehicle) + { + if(!m_pPlayerPed->FUNC_100ABFC0()) + field_FA = a1; + + if(((CVehicle *)pVehicle)->FUNC_100B7460()) + pGame->m_pGameCamera->FUNC_1009D740(); + + if(!((CVehicle *)pVehicle)->FUNC_100B7E00()) + { + bsSend.Write(a1); + pNetGame->GetRakClient()->RPC(RPC_ExitVehicle, &bsSend, HIGH_PRIORITY, RELIABLE_SEQUENCED, 0, FALSE); + } + } + } +}