CWatcherList::Find
0x00475250 · 157 bytes · __thiscall
_ZN12CWatcherList4FindEP11CBaseEntity
Decompiled
undefined (2 params)
/* CWatcherList::Find(CBaseEntity*) */
uint __thiscall CWatcherList::Find(CWatcherList *this,CBaseEntity *param_1)
{
uint *puVar1;
ushort uVar2;
uint uVar3;
uint uVar4;
undefined *puVar5;
uVar2 = *(ushort *)(DAT_00f7e88c + (uint)*(ushort *)this * 10);
do {
while( true ) {
if (uVar2 == 0xffff) {
return 0xffffffff;
}
uVar4 = (uint)uVar2;
puVar1 = (uint *)(g_WatcherList + uVar4 * 0xc);
uVar2 = *(ushort *)((int)puVar1 + 10);
uVar3 = *puVar1;
if (((uVar3 != 0xffffffff) &&
(puVar5 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar5 + 8) == uVar3 >> 0xc)) break;
if (param_1 == (CBaseEntity *)0x0) {
return uVar4;
}
}
} while (param_1 != *(CBaseEntity **)(puVar5 + 4));
return uVar4;
}
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.