L L4D2node

rr2::MatchList_t::SortByScoreDescending

0x00bd9170 · 238 bytes · __thiscall

_ZN3rr211MatchList_t21SortByScoreDescendingEv

Decompiled

undefined (1 param)

/* rr2::MatchList_t::SortByScoreDescending() */

void __thiscall rr2::MatchList_t::SortByScoreDescending(MatchList_t *this)

{
  float *pfVar1;
  float fVar2;
  undefined2 uVar3;
  undefined2 uVar4;
  size_t __nmemb;
  float fVar5;
  int iVar6;
  float *pfVar7;
  int local_2c;
  int local_20;
  
  __nmemb = *(size_t *)(this + 0xc);
  if (1 < (int)__nmemb) {
    if (*(void **)this == (void *)0x0) {
      local_2c = __nmemb - 1;
      do {
        if (0 < local_2c) {
          local_20 = 1;
          iVar6 = 0;
          while( true ) {
            pfVar1 = (float *)(*(int *)this + iVar6 + 0xc);
            pfVar7 = (float *)(iVar6 + *(int *)this);
            fVar2 = *pfVar7;
            if ((int)(*pfVar1 - fVar2) < 0) {
              uVar3 = *(undefined2 *)(pfVar7 + 1);
              uVar4 = *(undefined2 *)((int)pfVar7 + 6);
              fVar5 = pfVar7[2];
              *pfVar7 = *pfVar1;
              pfVar7[1] = pfVar1[1];
              pfVar7[2] = pfVar1[2];
              *pfVar1 = fVar2;
              *(undefined2 *)((int)pfVar1 + 6) = uVar4;
              pfVar1[2] = fVar5;
              *(undefined2 *)(pfVar1 + 1) = uVar3;
            }
            if (local_2c + 1 == local_20 + 1) break;
            local_20 = local_20 + 1;
            iVar6 = iVar6 + 0xc;
          }
        }
        local_2c = local_2c + -1;
      } while (local_2c != -1);
      return;
    }
    qsort(*(void **)this,__nmemb,0xc,MatchInfo_t::CompareByScoreDesc);
  }
  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)