L L4D2node

AI_CriteriaSet::WriteToEntity

0x005a9900 · 136 bytes · __thiscall

_ZN14AI_CriteriaSet13WriteToEntityEP11CBaseEntity

Decompiled

undefined (2 params)

/* AI_CriteriaSet::WriteToEntity(CBaseEntity*) */

void __thiscall AI_CriteriaSet::WriteToEntity(AI_CriteriaSet *this,CBaseEntity *param_1)

{
  short sVar1;
  char *pcVar2;
  char *pcVar3;
  int iVar4;
  
  if (0 < *(short *)(this + 0x12)) {
    sVar1 = CUtlRBTree<AI_CriteriaSet::CritEntry_t,short,bool(*)(AI_CriteriaSet::CritEntry_t_const&,AI_CriteriaSet::CritEntry_t_const&),CUtlMemory<UtlRBTreeNode_t<AI_CriteriaSet::CritEntry_t,short>,short>>
            ::FirstInorder((CUtlRBTree<AI_CriteriaSet::CritEntry_t,short,bool(*)(AI_CriteriaSet::CritEntry_t_const&,AI_CriteriaSet::CritEntry_t_const&),CUtlMemory<UtlRBTreeNode_t<AI_CriteriaSet::CritEntry_t,short>,short>>
                            *)this);
    iVar4 = (int)sVar1;
    if (-1 < iVar4) {
      while (iVar4 < *(short *)(this + 0x12)) {
        pcVar2 = (char *)GetValue(this,iVar4);
        pcVar3 = (char *)GetName(this,iVar4);
        CBaseEntity::AddContext(param_1,pcVar3,pcVar2,0.0);
        sVar1 = CUtlRBTree<AI_CriteriaSet::CritEntry_t,short,bool(*)(AI_CriteriaSet::CritEntry_t_const&,AI_CriteriaSet::CritEntry_t_const&),CUtlMemory<UtlRBTreeNode_t<AI_CriteriaSet::CritEntry_t,short>,short>>
                ::NextInorder((CUtlRBTree<AI_CriteriaSet::CritEntry_t,short,bool(*)(AI_CriteriaSet::CritEntry_t_const&,AI_CriteriaSet::CritEntry_t_const&),CUtlMemory<UtlRBTreeNode_t<AI_CriteriaSet::CritEntry_t,short>,short>>
                               *)this,(short)iVar4);
        iVar4 = (int)sVar1;
        if (iVar4 < 0) {
          return;
        }
      }
    }
  }
  return;
}

SourceMod gamedata

paste into addons/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.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)