L L4D2node

AI_CriteriaSet::Merge

0x005a9d00 · 254 bytes · __thiscall

_ZN14AI_CriteriaSet5MergeEPKS_

Decompiled

undefined (2 params)

/* AI_CriteriaSet::Merge(AI_CriteriaSet const*) */

void __thiscall AI_CriteriaSet::Merge(AI_CriteriaSet *this,AI_CriteriaSet *param_1)

{
  int iVar1;
  int iVar2;
  void *pvVar3;
  undefined4 uVar4;
  int iVar5;
  undefined4 uVar6;
  undefined2 local_1e [7];
  
  if (param_1 != (AI_CriteriaSet *)0x0) {
    iVar1 = (int)*(short *)(param_1 + 0x12);
    iVar2 = *(short *)(this + 0x12) + iVar1;
    if ((*(int *)(this + 8) < iVar2) && (-1 < *(int *)(this + 0xc))) {
      *(int *)(this + 8) = iVar2;
      if (*(void **)(this + 4) == (void *)0x0) {
        pvVar3 = malloc(iVar2 * 0x50);
        *(void **)(this + 4) = pvVar3;
      }
      else {
        pvVar3 = realloc(*(void **)(this + 4),iVar2 * 0x50);
        *(void **)(this + 4) = pvVar3;
      }
    }
    if (0 < iVar1) {
      iVar2 = 0;
      do {
        if (iVar2 < *(short *)(param_1 + 0x12)) {
          iVar5 = iVar2 * 0x50 + *(int *)(param_1 + 4);
          uVar6 = *(undefined4 *)(iVar5 + 0x4c);
          uVar4 = GetValue(param_1,iVar2);
          local_1e[0] = *(undefined2 *)(iVar5 + 8);
        }
        else {
          uVar4 = GetValue(param_1,iVar2);
          uVar6 = 0x3f800000;
          local_1e[0] = 0xffff;
        }
        iVar2 = iVar2 + 1;
        AppendCriteria(this,local_1e,uVar4,uVar6);
      } while (iVar2 < iVar1);
    }
  }
  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)