NPCPhysics_SolverExists
0x00793930 · 162 bytes · __cdecl
_Z23NPCPhysics_SolverExistsP11CAI_BaseNPCP11CBaseEntity
Decompiled
undefined (2 params)
/* NPCPhysics_SolverExists(CAI_BaseNPC*, CBaseEntity*) */
undefined4 NPCPhysics_SolverExists(CAI_BaseNPC *param_1,CBaseEntity *param_2)
{
int *piVar1;
uint uVar2;
int iVar3;
undefined *puVar4;
CAI_BaseNPC *pCVar5;
iVar3 = CEntityClassList<CPhysicsNPCSolver>::m_pClassList;
if (CEntityClassList<CPhysicsNPCSolver>::m_pClassList == 0) {
return 0;
}
do {
uVar2 = *(uint *)(iVar3 + 0x44c);
if (((uVar2 == 0xffffffff) ||
(puVar4 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar4 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar4 + 8) != uVar2 >> 0xc)) {
if (param_2 == (CBaseEntity *)0x0) goto LAB_00793990;
}
else if (param_2 == *(CBaseEntity **)(puVar4 + 4)) {
LAB_00793990:
uVar2 = *(uint *)(iVar3 + 0x448);
pCVar5 = (CAI_BaseNPC *)0x0;
if (((uVar2 != 0xffffffff) &&
(puVar4 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar4 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar4 + 8) == uVar2 >> 0xc)) {
pCVar5 = *(CAI_BaseNPC **)(puVar4 + 4);
}
if (param_1 == pCVar5) {
return 1;
}
}
piVar1 = (int *)(iVar3 + 0x444);
iVar3 = *piVar1;
if (*piVar1 == 0) {
return 0;
}
} while( true );
}
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.