From 80b6155fd6820aa00c8188e92ff34f78bb2c4169 Mon Sep 17 00:00:00 2001 From: ricardoofnl Date: Fri, 4 Sep 2026 21:14:02 +0700 Subject: [PATCH] [saco] Implement/match `CVehiclePool::FUNC_1001EEB0`; the sentinel stays 32-bit only while the loop exit assigns it --- saco/net/vehiclepool.cpp | 19 +++++++++++++++++++ saco/net/vehiclepool.h | 2 ++ 2 files changed, 21 insertions(+) diff --git a/saco/net/vehiclepool.cpp b/saco/net/vehiclepool.cpp index 66f2252..bde884d 100644 --- a/saco/net/vehiclepool.cpp +++ b/saco/net/vehiclepool.cpp @@ -170,3 +170,22 @@ void CVehiclePool::FUNC_1001ED70() } //---------------------------------------------------- + +short CVehiclePool::FUNC_1001EEB0(int a1, VECTOR *vecOrigin, VECTOR *vecLine) +{ + char colPoint[52]; + DWORD dwHitEntity = 0; + + ProcessLineOfSight(vecOrigin, vecLine, (VECTOR *)colPoint, &dwHitEntity, 0, 1, 0, 0, 0, 0, 0, 0); + if(!dwHitEntity) return -1; + + // the sentinel has to stay on the loop exit path, folding it into the return narrows it to 16 bits + int iVehicleID; + for(int i = 1; ; i++) { + if(i > field_0) { iVehicleID = INVALID_VEHICLE_ID; break; } + if(dwHitEntity == field_4FB4[i]) { iVehicleID = i; break; } + } + return iVehicleID; +} + +//---------------------------------------------------- diff --git a/saco/net/vehiclepool.h b/saco/net/vehiclepool.h index e35bbfa..bad83a8 100644 --- a/saco/net/vehiclepool.h +++ b/saco/net/vehiclepool.h @@ -55,6 +55,8 @@ public: int FUNC_1001EC00(); // .text:1001EC00 + short FUNC_1001EEB0(int a1, VECTOR *vecOrigin, VECTOR *vecLine); // .text:1001EEB0 + void FUNC_1001ED70(); // .text:1001ED70 char FUNC_1001EE20(VECTOR *vecStart, VECTOR *vecEnd); // .text:1001EE20