From 2eaeae5b56d362f744740e732a7df8784acd9d88 Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Sun, 5 May 2024 16:39:28 +0800 Subject: [PATCH] [saco] Implement and match `GamePool_GetBuilding()` --- saco/game/common.h | 7 +++++++ saco/game/util.cpp | 14 ++++++++++++++ saco/game/util.h | 3 +++ 3 files changed, 24 insertions(+) diff --git a/saco/game/common.h b/saco/game/common.h index de3af63..9cedff0 100644 --- a/saco/game/common.h +++ b/saco/game/common.h @@ -121,6 +121,13 @@ typedef struct _VEHICLE_TYPE //----------------------------------------------------------- +typedef struct _BUILDING_TYPE +{ + char _gap0[56]; +} BUILDING_TYPE; + +//----------------------------------------------------------- + #define TRAIN_PASSENGER_LOCO 537 #define TRAIN_FREIGHT_LOCO 538 #define TRAIN_PASSENGER 569 diff --git a/saco/game/util.cpp b/saco/game/util.cpp index 555d7aa..f16584d 100644 --- a/saco/game/util.cpp +++ b/saco/game/util.cpp @@ -1145,6 +1145,20 @@ PED_TYPE * __stdcall GamePool_FindPlayerPed() return *(PED_TYPE **)(0xB7CD98); } +//----------------------------------------------------------- + +BUILDING_TYPE * GamePool_GetBuilding() +{ + BUILDING_TYPE *pBuildingRet; + + _asm mov eax, 0xB74498 + _asm mov edx, [eax] + _asm mov eax, [edx] + _asm mov pBuildingRet, eax + + return pBuildingRet; +} + //----------------------------------------------------------- // Translate Weapon model ID into actual weapon ID. diff --git a/saco/game/util.h b/saco/game/util.h index 8f8cb63..ce8d62f 100644 --- a/saco/game/util.h +++ b/saco/game/util.h @@ -34,3 +34,6 @@ BOOL IsFileOrDirectoryExists(char * szPath); DWORD unnamed_100B6100(char *szString, int nMaxLen); bool unnamed_100B4B50(VECTOR *vecPos); + +BUILDING_TYPE * GamePool_GetBuilding(); +