L L4D2node

CUtlSortVector<CaptionLookup_t,CCaptionLookupLess>::Find

0x004b6170 · 200 bytes · __thiscall

_ZNK14CUtlSortVectorI15CaptionLookup_t18CCaptionLookupLessE4FindERKS0_

Decompiled

undefined (2 params)

/* CUtlSortVector<CaptionLookup_t, CCaptionLookupLess>::Find(CaptionLookup_t const&) const */

int __thiscall
CUtlSortVector<CaptionLookup_t,CCaptionLookupLess>::Find
          (CUtlSortVector<CaptionLookup_t,CCaptionLookupLess> *this,CaptionLookup_t *param_1)

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