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); +