L L4D2node

CDmxElement::Resort

0x00be70b0 · 202 bytes · __thiscall

_ZNK11CDmxElement6ResortEv.part.31

Decompiled

undefined (1 param)

/* CDmxElement::Resort() const [clone .part.31] */

void __thiscall CDmxElement::Resort(CDmxElement *this)

{
  CDmxAttribute *this_00;
  int iVar1;
  CUtlVector<CDmxAttribute*,CUtlMemory<CDmxAttribute*,int>> *in_EAX;
  undefined4 uVar2;
  int iVar3;
  size_t __nmemb;
  undefined1 local_25;
  undefined4 local_24;
  undefined1 *local_20;
  
  if (in_EAX[0x18] == (CUtlVector<CDmxAttribute*,CUtlMemory<CDmxAttribute*,int>>)0x0) {
    __nmemb = *(size_t *)(in_EAX + 0xc);
  }
  else {
    __nmemb = *(size_t *)(in_EAX + 0xc);
    in_EAX[0x18] = (CUtlVector<CDmxAttribute*,CUtlMemory<CDmxAttribute*,int>>)0x0;
    if (1 < (int)__nmemb) {
      local_24 = *(undefined4 *)(in_EAX + 0x14);
      local_20 = &local_25;
      g_pUtlSortVectorQSortContext = &local_24;
      qsort(*(void **)in_EAX,__nmemb,4,
            CUtlSortVector<CDmxAttribute*,CDmxAttributeLess>::CompareHelper);
      __nmemb = *(size_t *)(in_EAX + 0xc);
    }
  }
  in_EAX[0x2f] = (CUtlVector<CDmxAttribute*,CUtlMemory<CDmxAttribute*,int>>)
                 ((byte)in_EAX[0x2f] & 0xfe);
  iVar3 = __nmemb * 4 + -8;
  while (__nmemb = __nmemb - 1, 0 < (int)__nmemb) {
    this_00 = *(CDmxAttribute **)(*(int *)in_EAX + 4 + iVar3);
    if (((this_00 != (CDmxAttribute *)0x0) && (iVar1 = *(int *)(*(int *)in_EAX + iVar3), iVar1 != 0)
        ) && (*(short *)(iVar1 + 4) == *(short *)(this_00 + 4))) {
      uVar2 = CDmxAttribute::GetName(this_00);
      Warning("Duplicate attribute name %s encountered!\n",uVar2);
      CUtlVector<CDmxAttribute*,CUtlMemory<CDmxAttribute*,int>>::ShiftElementsLeft(in_EAX,__nmemb,1)
      ;
      *(int *)(in_EAX + 0xc) = *(int *)(in_EAX + 0xc) + -1;
    }
    iVar3 = iVar3 + -4;
  }
  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)