L L4D2node

CTeamplayRoundBasedRules::AddPlayedRound

0x004cc7b0 · 367 bytes · __thiscall

_ZN24CTeamplayRoundBasedRules14AddPlayedRoundE8string_t

Decompiled

undefined (2 params)

/* CTeamplayRoundBasedRules::AddPlayedRound(string_t) */

void __thiscall CTeamplayRoundBasedRules::AddPlayedRound(CTeamplayRoundBasedRules *this,int param_2)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  int iVar4;
  int iVar5;
  
  if (param_2 == 0) {
    return;
  }
  iVar5 = *(int *)(this + 0x27c);
  iVar3 = *(int *)(this + 0x274);
  iVar1 = iVar5 + 1;
  if (iVar3 < iVar1) {
    iVar4 = *(int *)(this + 0x278);
    if (-1 < iVar4) {
      if (iVar4 == 0) {
        if (iVar3 == 0) {
          if (iVar1 < 9) {
            iVar4 = 8;
            goto LAB_004cc8bf;
          }
          iVar3 = 8;
        }
        do {
          iVar4 = iVar3 * 2;
          if (iVar1 <= iVar4) break;
          iVar4 = iVar3 * 4;
          iVar3 = iVar4;
        } while (iVar4 < iVar1);
      }
      else {
        for (iVar4 = (iVar5 / iVar4 + 1) * iVar4; iVar4 < iVar1; iVar4 = (iVar4 + iVar1) / 2) {
        }
      }
LAB_004cc8bf:
      *(int *)(this + 0x274) = iVar4;
      if (*(void **)(this + 0x270) == (void *)0x0) {
        piVar2 = malloc(iVar4 << 2);
        *(int **)(this + 0x270) = piVar2;
      }
      else {
        piVar2 = realloc(*(void **)(this + 0x270),iVar4 << 2);
        iVar5 = *(int *)(this + 0x27c);
        *(int **)(this + 0x270) = piVar2;
        iVar1 = iVar5 + 1;
      }
      goto LAB_004cc7e4;
    }
  }
  piVar2 = *(int **)(this + 0x270);
LAB_004cc7e4:
  *(int *)(this + 0x27c) = iVar1;
  *(int **)(this + 0x280) = piVar2;
  if (0 < iVar5) {
    _V_memmove(piVar2 + 1,piVar2,iVar5 << 2);
    piVar2 = *(int **)(this + 0x270);
  }
  if (piVar2 != (int *)0x0) {
    *piVar2 = param_2;
  }
  iVar1 = *(int *)(this + 0x27c);
  if (2 < iVar1) {
    iVar5 = iVar1 + -1;
    iVar3 = iVar1 * 4;
    do {
      iVar4 = (iVar1 - iVar5) + -1;
      if (0 < iVar4) {
        _V_memmove((void *)(*(int *)(this + 0x270) + iVar3 + -4),
                   (void *)(iVar3 + *(int *)(this + 0x270)),iVar4 * 4);
        iVar1 = *(int *)(this + 0x27c);
      }
      iVar5 = iVar5 + -1;
      iVar1 = iVar1 + -1;
      *(int *)(this + 0x27c) = iVar1;
      iVar3 = iVar3 + -4;
    } while (iVar5 != 1);
  }
  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)