2
0
mirror of https://github.com/rehlds/reapi.git synced 2024-12-28 07:35:31 +03:00

Implemented ATYPE_TRACE for SetHookChainArg native useful for replacement data on tracehandle argument

This commit is contained in:
s1lentq 2023-07-15 03:39:05 +07:00
parent 8c670fa40f
commit 7c959fa9bd
4 changed files with 10 additions and 3 deletions

View File

@ -130,7 +130,8 @@ enum AType
ATYPE_EDICT,
ATYPE_EVARS,
ATYPE_BOOL,
ATYPE_VECTOR
ATYPE_VECTOR,
ATYPE_TRACE
};
enum HookChain

View File

@ -21,7 +21,8 @@ enum AType : uint8
ATYPE_EDICT,
ATYPE_EVARS,
ATYPE_BOOL,
ATYPE_VECTOR
ATYPE_VECTOR,
ATYPE_TRACE
};
struct retval_t
@ -53,6 +54,7 @@ inline AType getApiType(entvars_t *) { return ATYPE_EVARS; }
inline AType getApiType(bool) { return ATYPE_BOOL; }
inline AType getApiType(Vector) { return ATYPE_VECTOR; }
inline AType getApiType(ENTITYINIT) { return ATYPE_INTEGER; }
inline AType getApiType(TraceResult*) { return ATYPE_TRACE; }
template<typename T>
inline AType getApiType(T *) { return ATYPE_INTEGER; }

View File

@ -322,6 +322,9 @@ cell AMX_NATIVE_CALL SetHookChainArg(AMX *amx, cell *params)
case ATYPE_EVARS:
*(entvars_t **)destAddr = PEV(*srcAddr);
break;
case ATYPE_TRACE:
**(TraceResult **)destAddr = *(TraceResult *)(*srcAddr);
break;
default:
return FALSE;
}

View File

@ -250,7 +250,8 @@ const char *getATypeStr(AType type)
"ATYPE_EDICT",
"ATYPE_EVARS",
"ATYPE_BOOL",
"ATYPE_VECTOR"
"ATYPE_VECTOR",
"ATYPE_TRACE"
};
if (type >= arraysize(s_ATypes))