diff --git a/saco/game/util.cpp b/saco/game/util.cpp index 1a5b168..b12d83e 100644 --- a/saco/game/util.cpp +++ b/saco/game/util.cpp @@ -1376,6 +1376,26 @@ DWORD * GetNextTaskFromTask(DWORD *task) //----------------------------------------------------------- +int GetTaskTypeFromTask(DWORD *task) +{ + int i = 0; + + if(!task || *task < 0x800000 || *task > 0x900000) return 0; + + _asm pushad + _asm mov edx, task + _asm mov ebx, [edx] + _asm mov edx, [ebx+10h] + _asm mov ecx, task + _asm call edx + _asm mov i, eax + _asm popad + + return i; +} + +//----------------------------------------------------------- + BOOL __stdcall GameIsEntityOnScreen(DWORD * pdwEnt) { BOOL bResult = FALSE; diff --git a/saco/game/util.h b/saco/game/util.h index 31623c8..51fbb47 100644 --- a/saco/game/util.h +++ b/saco/game/util.h @@ -74,4 +74,5 @@ void RemoveColorEmbedsFromString(char *szString); UINT GetVehicleSubtypeFromVehiclePtr(VEHICLE_TYPE *pVehicle); DWORD * GetNextTaskFromTask(DWORD *task); +int GetTaskTypeFromTask(DWORD *task);