L L4D2node

CUtlVector<rr2::CriterionLambda,CUtlMemoryConservative<rr2::CriterionLambda>>::InsertBefore

0x00bdb3f0 · 240 bytes · __thiscall

_ZN10CUtlVectorIN3rr215CriterionLambdaE22CUtlMemoryConservativeIS1_EE12InsertBeforeEiRKS1_

Decompiled

undefined (3 params)

/* CUtlVector<rr2::CriterionLambda, CUtlMemoryConservative<rr2::CriterionLambda>
   >::InsertBefore(int, rr2::CriterionLambda const&) */

int __thiscall
CUtlVector<rr2::CriterionLambda,CUtlMemoryConservative<rr2::CriterionLambda>>::InsertBefore
          (CUtlVector<rr2::CriterionLambda,CUtlMemoryConservative<rr2::CriterionLambda>> *this,
          int param_1,CriterionLambda *param_2)

{
  int *piVar1;
  undefined2 uVar2;
  int *piVar3;
  char cVar4;
  undefined2 *puVar5;
  void *pvVar6;
  int iVar7;
  int iVar8;
  
  iVar7 = *(int *)(this + 8) + 1;
  if ((int)(*(uint *)(this + 4) / 0xc) < iVar7) {
    pvVar6 = realloc(*(void **)this,iVar7 * 0xc);
    *(void **)this = pvVar6;
    *(int *)(this + 4) = iVar7 * 0xc;
    iVar7 = *(int *)(this + 8) + 1;
  }
  else {
    pvVar6 = *(void **)this;
  }
  *(int *)(this + 8) = iVar7;
  iVar7 = (iVar7 - param_1) + -1;
  iVar8 = param_1 * 0xc;
  *(void **)(this + 0xc) = pvVar6;
  if (0 < iVar7) {
    _V_memmove((void *)((int)pvVar6 + iVar8 + 0xc),(void *)((int)pvVar6 + iVar8),iVar7 * 0xc);
    pvVar6 = *(void **)this;
  }
  puVar5 = (undefined2 *)((int)pvVar6 + iVar8);
  if (puVar5 != (undefined2 *)0x0) {
    uVar2 = *(undefined2 *)param_2;
    *(undefined4 *)(puVar5 + 2) = 0x3f800000;
    *(undefined4 *)(puVar5 + 4) = 0;
    *puVar5 = uVar2;
    iVar7 = *(int *)(param_2 + 8);
    if (iVar7 != 0) {
      LOCK();
      *(int *)(iVar7 + 4) = *(int *)(iVar7 + 4) + 1;
      UNLOCK();
      piVar3 = *(int **)(puVar5 + 4);
      if (piVar3 != (int *)0x0) {
        LOCK();
        piVar1 = piVar3 + 1;
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        if (*piVar1 == 0) {
          cVar4 = (**(code **)(*piVar3 + 8))(piVar3);
          if (cVar4 != '\0') {
            (**(code **)(*piVar3 + 4))(piVar3);
          }
        }
      }
      *(int *)(puVar5 + 4) = iVar7;
    }
  }
  return param_1;
}

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)