L L4D2node

AI_CriteriaSet::AppendCriteria

0x005a9a10 · 227 bytes · __thiscall

_ZN14AI_CriteriaSet14AppendCriteriaE10CUtlSymbolPKcf

Decompiled

undefined (4 params)

/* AI_CriteriaSet::AppendCriteria(CUtlSymbol, char const*, float) */

void __thiscall
AI_CriteriaSet::AppendCriteria
          (AI_CriteriaSet *this,undefined2 *param_2,char *param_3,undefined4 param_4)

{
  int iVar1;
  short sVar2;
  int iVar3;
  char *pcVar4;
  int in_GS_OFFSET;
  undefined2 local_6a;
  undefined2 local_68;
  undefined1 local_66;
  undefined4 local_24;
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  local_6a = *param_2;
  iVar3 = FindCriterionIndex(this,&local_6a);
  sVar2 = (short)iVar3;
  if (iVar3 == -1) {
    local_68 = *param_2;
    local_24 = 0;
    local_66 = 0;
    sVar2 = 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>>
            ::Insert((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,(CritEntry_t *)&local_68);
    local_6a = *param_2;
    pcVar4 = (char *)CUtlSymbolTable::String((CUtlSymbolTable *)sm_CriteriaSymbols,&local_6a);
    if (*pcVar4 == '$') {
      *(int *)(this + 0x1c) = *(int *)(this + 0x1c) + 1;
    }
  }
  iVar3 = sVar2 * 0x50 + *(int *)(this + 4);
  if (param_3 == (char *)0x0) {
    *(undefined1 *)(iVar3 + 10) = 0;
  }
  else {
    V_strncpy((char *)(iVar3 + 10),param_3,0x40);
  }
  iVar1 = *(int *)(in_GS_OFFSET + 0x14);
  *(undefined4 *)(iVar3 + 0x4c) = param_4;
  if (local_20 == iVar1) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}

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)