CBaseEntity::ThinkSet
0x00410aa0 · 243 bytes · __cdecl
_ZN11CBaseEntity8ThinkSetEMS_FvvEfPKc
Decompiled
undefined (3 params)
/* CBaseEntity::ThinkSet(void (CBaseEntity::*)(), float, char const*) */
_func_void * CBaseEntity::ThinkSet(_func_void *param_1,float param_2,char *param_3)
{
int iVar1;
int iVar2;
bool bVar3;
undefined4 in_stack_00000010;
float in_stack_00000014;
char *in_stack_00000018;
if (in_stack_00000018 != (char *)0x0) {
iVar1 = GetIndexForThinkContext((CBaseEntity *)param_2,in_stack_00000018);
if (iVar1 == -1) {
iVar1 = RegisterThinkContext((CBaseEntity *)param_2,in_stack_00000018);
}
iVar1 = iVar1 * 0x14;
iVar2 = *(int *)((int)param_2 + 0xa4);
*(char **)(iVar2 + iVar1) = param_3;
*(undefined4 *)(iVar2 + 4 + iVar1) = in_stack_00000010;
if (in_stack_00000014 != 0.0) {
if (in_stack_00000014 == -1.0) {
bVar3 = false;
iVar2 = -1;
}
else {
iVar2 = (int)(in_stack_00000014 / *(float *)(gpGlobals + 0x1c) + 0.5);
bVar3 = iVar2 != -1;
}
*(int *)(*(int *)((int)param_2 + 0xa4) + 0xc + iVar1) = iVar2;
CheckHasThinkFunction((CBaseEntity *)param_2,bVar3);
}
*(char **)param_1 = param_3;
*(undefined4 *)(param_1 + 4) = in_stack_00000010;
return param_1;
}
*(char **)param_1 = param_3;
*(undefined4 *)(param_1 + 4) = in_stack_00000010;
*(char **)((int)param_2 + 0x1c) = param_3;
*(undefined4 *)((int)param_2 + 0x20) = in_stack_00000010;
return param_1;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
used as the SourceMod key — change to fit your plugin's convention
SourceMod library name (server / engine / matchmaking)
Just a Signatures{} block, ready to drop into a gamedata
file. Wire it up in your plugin however you like - SDKCall, DHooks,
raw memory ops, or anything else.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.