CAI_Expresser::SemaphoreIsAvailable
0x005d1790 · 147 bytes · __thiscall
_ZN13CAI_Expresser20SemaphoreIsAvailableEP11CBaseEntity
Decompiled
undefined (2 params)
/* CAI_Expresser::SemaphoreIsAvailable(CBaseEntity*) */
undefined * __thiscall CAI_Expresser::SemaphoreIsAvailable(CAI_Expresser *this,CBaseEntity *param_1)
{
float fVar1;
char cVar2;
float *pfVar3;
CBaseEntity *pCVar4;
undefined *puVar5;
cVar2 = (**(code **)(**(int **)(this + 4) + 8))(*(int **)(this + 4));
if (cVar2 != '\0') {
CBaseEntity::MyNPCPointer();
pfVar3 = (float *)GetMySpeechSemaphore((CBaseEntity *)this);
if (pfVar3 != (float *)0x0) {
puVar5 = (undefined *)0x1;
if (*(float *)(gpGlobals + 0xc) < *pfVar3 || *(float *)(gpGlobals + 0xc) == *pfVar3) {
fVar1 = pfVar3[1];
pCVar4 = (CBaseEntity *)0x0;
if (((fVar1 != -NAN) &&
(puVar5 = g_pEntityList + ((uint)fVar1 & 0xfff) * 0x10,
puVar5 != (undefined *)0xfffffffc)) && (*(uint *)(puVar5 + 8) == (uint)fVar1 >> 0xc)) {
pCVar4 = *(CBaseEntity **)(puVar5 + 4);
}
puVar5 = (undefined *)CONCAT31((int3)((uint)puVar5 >> 8),param_1 == pCVar4);
}
return puVar5;
}
}
return (undefined *)0x1;
}
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.