From 24b3ff60395769e2df8c580a22aa476209825bc1 Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Sat, 2 Nov 2024 22:36:15 +0800 Subject: [PATCH] [saco] Implement/match `GetNextTaskFromTask(...)` --- saco/game/util.cpp | 20 ++++++++++++++++++++ saco/game/util.h | 2 ++ 2 files changed, 22 insertions(+) diff --git a/saco/game/util.cpp b/saco/game/util.cpp index cb4fb97..1a5b168 100644 --- a/saco/game/util.cpp +++ b/saco/game/util.cpp @@ -1356,6 +1356,26 @@ int __stdcall GameGetWeaponModelIDFromWeaponID(int iWeaponID) //----------------------------------------------------------- +DWORD * GetNextTaskFromTask(DWORD *task) +{ + DWORD *ret_task=NULL; + + if(!task || *task < 0x800000 || *task > 0x900000) return NULL; + + _asm pushad + _asm mov edx, task + _asm mov ebx, [edx] + _asm mov edx, [ebx+8] + _asm mov ecx, task + _asm call edx + _asm mov ret_task, eax + _asm popad + + return ret_task; +} + +//----------------------------------------------------------- + BOOL __stdcall GameIsEntityOnScreen(DWORD * pdwEnt) { BOOL bResult = FALSE; diff --git a/saco/game/util.h b/saco/game/util.h index 7c6b93f..31623c8 100644 --- a/saco/game/util.h +++ b/saco/game/util.h @@ -73,3 +73,5 @@ void RemoveColorEmbedsFromString(char *szString); UINT GetVehicleSubtypeFromVehiclePtr(VEHICLE_TYPE *pVehicle); +DWORD * GetNextTaskFromTask(DWORD *task); +