L L4D2node

CMapReslistGenerator::RunFrame

0x0018bd60 · 402 bytes · __thiscall

_ZN20CMapReslistGenerator8RunFrameEv

Decompiled

undefined (1 param)

/* CMapReslistGenerator::RunFrame() */

void __thiscall CMapReslistGenerator::RunFrame(CMapReslistGenerator *this)

{
  float fVar1;
  undefined4 uVar2;
  undefined4 uVar3;
  int iVar4;
  int *piVar5;
  longdouble lVar6;
  
  if (this[1] == (CMapReslistGenerator)0x0) {
    if (this[6] != (CMapReslistGenerator)0x0) {
      this[6] = (CMapReslistGenerator)0x0;
LAB_0018be7c:
      DoQuit(this);
      return;
    }
  }
  else {
    iVar4 = *(int *)(this + 0x24);
    *(int *)(this + 0x24) = iVar4 + -1;
    if (((iVar4 + -1 < 1) && (fVar1 = *(float *)(this + 0x20), fVar1 != 0.0)) &&
       (lVar6 = (longdouble)Plat_FloatTime(), fVar1 < (float)lVar6)) {
      WriteMapLog(this);
      iVar4 = *(int *)(this + 0x1c);
      if ((iVar4 < 0) || (*(int *)(this + 0x14) <= iVar4)) {
        piVar5 = (int *)CommandLine_Tier0();
        iVar4 = (**(code **)(*piVar5 + 0x28))(piVar5,"-forever");
        if (iVar4 == 0) goto LAB_0018be7c;
        StartReslistGeneration(this);
        this[3] = (CMapReslistGenerator)0x1;
      }
      else {
        *(undefined4 *)(this + 0x20) = 0;
        *(undefined4 *)(this + 0x24) = 0;
        if (this[3] != (CMapReslistGenerator)0x0) {
          piVar5 = (int *)CommandLine_Tier0();
          (**(code **)(*piVar5 + 0x10))(piVar5,"-startmap");
          piVar5 = (int *)CommandLine_Tier0();
          (**(code **)(*piVar5 + 0x14))
                    (piVar5,"-startmap",*(int *)(this + 0x1c) * 0x40 + *(int *)(this + 8));
          HostState_Restart();
          return;
        }
        uVar2 = va("map %s\n",iVar4 * 0x40 + *(int *)(this + 8));
        uVar3 = Cbuf_GetCurrentPlayer();
        Cbuf_AddText(uVar3,uVar2,0);
        V_snprintf((char *)(this + 0x68),0x40,"%s:  ",
                   *(int *)(this + 0x1c) * 0x40 + *(int *)(this + 8));
        iVar4 = *(int *)(this + 0x1c) + 1;
        *(int *)(this + 0x1c) = iVar4;
        if ((-1 < iVar4) && (iVar4 < *(int *)(this + 0x14))) {
          this[3] = (CMapReslistGenerator)0x1;
        }
      }
    }
  }
  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)