L L4D2node

CUtlSortVector<int,WingedEdgeLessFunc>::FindLessOrEqual

0x001cf1a0 · 462 bytes · __thiscall

_ZNK14CUtlSortVectorIi18WingedEdgeLessFuncE15FindLessOrEqualERKi

Decompiled

undefined (2 params)

/* CUtlSortVector<int, WingedEdgeLessFunc>::FindLessOrEqual(int const&) const */

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

{
  float *pfVar1;
  float *pfVar2;
  float *pfVar3;
  float fVar4;
  float fVar5;
  int iVar6;
  int iVar7;
  char cVar8;
  int iVar9;
  int iVar10;
  int iVar11;
  float fVar12;
  float fVar13;
  int local_20;
  
  if ((this[0x18] != (CUtlSortVector<int,WingedEdgeLessFunc>)0x0) &&
     (iVar9 = LoggingSystem_LogAssert
                        ("%s (%d) : %s\n","/data/src/public/tier1/utlsortvector.h",0xf4,
                         "Assertion Failed: !m_bNeedsSort"), iVar9 == 1)) {
    cVar8 = ShouldUseNewAssertDialog();
    if ((cVar8 == '\0') ||
       (cVar8 = DoNewAssertDialog("/data/src/public/tier1/utlsortvector.h",0xf4,
                                  "Assertion Failed: !m_bNeedsSort"), cVar8 != '\0')) {
      raise(5);
    }
    _ExitOnFatalAssert("/data/src/public/tier1/utlsortvector.h",0xf4);
  }
  iVar9 = *(int *)(this + 0xc) + -1;
  if (-1 < iVar9) {
    iVar6 = *(int *)(this + 0x14);
    local_20 = 0;
    iVar10 = *param_1 * 0xc;
    pfVar1 = (float *)(iVar6 + (uint)(byte)(&s_pEdges)[iVar10 + (&DAT_00341748)[*param_1 * 3]] * 0xc
                      );
    fVar4 = pfVar1[1];
    do {
      while( true ) {
        iVar11 = local_20 + iVar9 >> 1;
        iVar7 = *(int *)(*(int *)this + iVar11 * 4);
        pfVar3 = (float *)(iVar6 + (uint)(byte)(&s_pEdges)[iVar7 * 0xc + (&DAT_00341748)[iVar7 * 3]]
                                   * 0xc);
        fVar12 = pfVar3[1];
        if (fVar4 <= fVar12) break;
LAB_001cf2dd:
        local_20 = iVar11 + 1;
        if (iVar9 < local_20) {
          return iVar9;
        }
      }
      if (fVar12 <= fVar4) {
        fVar13 = *pfVar3;
        fVar5 = *pfVar1;
        if (fVar13 < fVar5) goto LAB_001cf2dd;
        if (fVar13 <= fVar5) {
          pfVar3 = (float *)(iVar6 + (uint)(byte)(&DAT_00341741)
                                                 [iVar7 * 0xc - (&DAT_00341748)[iVar7 * 3]] * 0xc);
          pfVar2 = (float *)(iVar6 + (uint)(byte)(&DAT_00341741)
                                                 [iVar10 - (&DAT_00341748)[*param_1 * 3]] * 0xc);
          fVar13 = (pfVar2[1] - fVar4) * (*pfVar3 - fVar13);
          fVar12 = (*pfVar2 - fVar5) * (pfVar3[1] - fVar12);
          if (fVar13 <= fVar12) goto LAB_001cf2dd;
          if (fVar13 < fVar12) {
            return iVar11;
          }
        }
      }
      iVar9 = iVar11 + -1;
    } while (local_20 <= iVar9);
  }
  return iVar9;
}

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)