L L4D2node

CUtlSortVector<unsigned_short,CEdgeList::EdgeLess>::FindLessOrEqual

0x001cef80 · 287 bytes · __thiscall

_ZNK14CUtlSortVectorItN9CEdgeList8EdgeLessEE15FindLessOrEqualERKt

Decompiled

undefined (2 params)

/* CUtlSortVector<unsigned short, CEdgeList::EdgeLess>::FindLessOrEqual(unsigned short const&) const
    */

int __thiscall
CUtlSortVector<unsigned_short,CEdgeList::EdgeLess>::FindLessOrEqual
          (CUtlSortVector<unsigned_short,CEdgeList::EdgeLess> *this,ushort *param_1)

{
  ushort *puVar1;
  void *pvVar2;
  int iVar3;
  char cVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  EdgeLess local_1d [13];
  
  if ((this[0x18] != (CUtlSortVector<unsigned_short,CEdgeList::EdgeLess>)0x0) &&
     (iVar7 = LoggingSystem_LogAssert
                        ("%s (%d) : %s\n","/data/src/public/tier1/utlsortvector.h",0xf4,
                         "Assertion Failed: !m_bNeedsSort"), iVar7 == 1)) {
    cVar4 = ShouldUseNewAssertDialog();
    if ((cVar4 == '\0') ||
       (cVar4 = DoNewAssertDialog("/data/src/public/tier1/utlsortvector.h",0xf4,
                                  "Assertion Failed: !m_bNeedsSort"), cVar4 != '\0')) {
      raise(5);
    }
    _ExitOnFatalAssert("/data/src/public/tier1/utlsortvector.h",0xf4);
  }
  iVar7 = *(int *)(this + 0xc) + -1;
  if (-1 < iVar7) {
    pvVar2 = *(void **)(this + 0x14);
    iVar6 = 0;
    iVar3 = *(int *)this;
    do {
      while( true ) {
        iVar5 = iVar6 + iVar7 >> 1;
        puVar1 = (ushort *)(iVar3 + iVar5 * 2);
        cVar4 = CEdgeList::EdgeLess::Less(local_1d,puVar1,param_1,pvVar2);
        if (cVar4 != '\0') break;
        cVar4 = CEdgeList::EdgeLess::Less(local_1d,param_1,puVar1,pvVar2);
        if (cVar4 == '\0') {
          return iVar5;
        }
        iVar7 = iVar5 + -1;
        if (iVar7 < iVar6) {
          return iVar7;
        }
      }
      iVar6 = iVar5 + 1;
    } while (iVar6 <= iVar7);
  }
  return iVar7;
}

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)