CBaseEntity::AppendContextToCriteria
0x006138c0 · 296 bytes · __thiscall
_ZN11CBaseEntity23AppendContextToCriteriaER14AI_CriteriaSetPKc
Decompiled
undefined (3 params)
/* CBaseEntity::AppendContextToCriteria(AI_CriteriaSet&, char const*) */
void __thiscall
CBaseEntity::AppendContextToCriteria(CBaseEntity *this,AI_CriteriaSet *param_1,char *param_2)
{
int iVar1;
char *pcVar2;
char *pcVar3;
int iVar4;
int in_GS_OFFSET;
char local_a0 [128];
int local_20;
iVar4 = 0;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
RemoveExpiredConcepts(this);
iVar1 = *(int *)(this + 0xc4);
if (0 < iVar1) {
do {
while( true ) {
pcVar2 = (char *)GetContextName(this,iVar4);
pcVar3 = (char *)GetContextValue(this,iVar4);
if ((param_2 == (char *)0x0) || (*param_2 == '\0')) break;
iVar4 = iVar4 + 1;
V_snprintf(local_a0,0x80,"%s%s",param_2,pcVar2);
AI_CriteriaSet::AppendCriteria(param_1,local_a0,pcVar3,1.0);
if (iVar4 == iVar1) goto LAB_006139cf;
}
iVar4 = iVar4 + 1;
AI_CriteriaSet::AppendCriteria(param_1,pcVar2,pcVar3,1.0);
} while (iVar4 != iVar1);
}
LAB_006139cf:
if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
return;
}
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.