L L4D2node

CUtlSortVector<modelsize_t,CModelsize_Less>::FindLessOrEqual

0x0019e9f0 · 201 bytes · __thiscall

_ZNK14CUtlSortVectorI11modelsize_t15CModelsize_LessE15FindLessOrEqualERKS0_

Decompiled

undefined (2 params)

/* CUtlSortVector<modelsize_t, CModelsize_Less>::FindLessOrEqual(modelsize_t const&) const */

int __thiscall
CUtlSortVector<modelsize_t,CModelsize_Less>::FindLessOrEqual
          (CUtlSortVector<modelsize_t,CModelsize_Less> *this,modelsize_t *param_1)

{
  int iVar1;
  char cVar2;
  int iVar3;
  int iVar4;
  int iVar5;
  
  if ((this[0x18] != (CUtlSortVector<modelsize_t,CModelsize_Less>)0x0) &&
     (iVar3 = LoggingSystem_LogAssert
                        ("%s (%d) : %s\n","/data/src/public/tier1/utlsortvector.h",0xf4,
                         "Assertion Failed: !m_bNeedsSort"), iVar3 == 1)) {
    cVar2 = ShouldUseNewAssertDialog();
    if ((cVar2 == '\0') ||
       (cVar2 = DoNewAssertDialog("/data/src/public/tier1/utlsortvector.h",0xf4,
                                  "Assertion Failed: !m_bNeedsSort"), cVar2 != '\0')) {
      raise(5);
    }
    _ExitOnFatalAssert("/data/src/public/tier1/utlsortvector.h",0xf4);
  }
  iVar3 = *(int *)(this + 0xc) + -1;
  if (-1 < iVar3) {
    iVar4 = 0;
    do {
      while( true ) {
        iVar5 = iVar4 + iVar3 >> 1;
        iVar1 = *(int *)(*(int *)this + 4 + iVar5 * 8);
        if (iVar1 < *(int *)(param_1 + 4)) break;
        if (iVar1 <= *(int *)(param_1 + 4)) {
          return iVar5;
        }
        iVar3 = iVar5 + -1;
        if (iVar3 < iVar4) {
          return iVar3;
        }
      }
      iVar4 = iVar5 + 1;
    } while (iVar4 <= iVar3);
  }
  return iVar3;
}

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)