L L4D2node

CTeamplayRoundBasedRules::State_Think_RND_RUNNING

0x004cd9b0 · 562 bytes · __thiscall

_ZN24CTeamplayRoundBasedRules23State_Think_RND_RUNNINGEv

Decompiled

undefined (1 param)

/* CTeamplayRoundBasedRules::State_Think_RND_RUNNING() */

void __thiscall CTeamplayRoundBasedRules::State_Think_RND_RUNNING(CTeamplayRoundBasedRules *this)

{
  bool bVar1;
  char cVar2;
  int iVar3;
  int iVar4;
  int *piVar5;
  int iVar6;
  int iVar7;
  int iVar8;
  int local_24;
  
  iVar3 = (**(code **)(*(int *)this + 0x2f8))(this);
  if (iVar3 < 1) {
    State_Leave(this);
    State_Enter(this,1);
    return;
  }
  if (*(float *)(this + 0x45c) <= *(float *)(gpGlobals + 0xc) &&
      *(float *)(gpGlobals + 0xc) != *(float *)(this + 0x45c)) {
    BalanceTeams(this,true);
    *(float *)(this + 0x45c) = *(float *)(gpGlobals + 0xc) + 1.0;
  }
  CheckRespawnWaves(this);
  CheckReadyRestart(this);
  if ((((this[0x308] != (CTeamplayRoundBasedRules)0x0) ||
       ((cVar2 = (**(code **)(*(int *)this + 0x2d0))(this), cVar2 == '\0' &&
        (*(int *)(mp_stalemate_at_timelimit._28_4_ + 0x30) != 0)))) && (*(int *)(this + 0x318) == 4)
      ) && ((0 < *(int *)(mp_timelimit._28_4_ + 0x30) &&
            ((*(int *)(mp_tournament._28_4_ + 0x30) == 0 ||
             (this[0x328] == (CTeamplayRoundBasedRules)0x0)))))) {
    iVar7 = (int)(((float)(*(int *)(mp_timelimit._28_4_ + 0x30) * 0x3c) -
                  *(float *)(gpGlobals + 0xc)) + *(float *)(this + 0x330));
    iVar3 = 0;
    if (-1 < iVar7) {
      iVar3 = iVar7;
    }
    if ((double)iVar3 <= 0.5) {
      bVar1 = true;
      local_24 = 0;
      iVar3 = -1;
      for (iVar7 = 2; iVar4 = GetNumberOfTeams(), iVar7 < iVar4; iVar7 = iVar7 + 1) {
        if (!bVar1) goto LAB_004cdb06;
        piVar5 = (int *)GetGlobalTeam(iVar7);
        iVar6 = (**(code **)(*piVar5 + 0x364))(piVar5);
        iVar4 = iVar7;
        if (((iVar3 < iVar6) || (iVar8 = iVar3, iVar4 = local_24, iVar3 != iVar6)) &&
           (local_24 = iVar4, iVar8 = iVar6, iVar3 != -1)) {
          bVar1 = false;
          iVar8 = iVar3;
        }
        iVar3 = iVar8;
      }
      if (bVar1) {
        cVar2 = (**(code **)(*(int *)this + 0x2f0))(this);
        if (cVar2 == '\0') {
          SetOvertime(this,true);
        }
        else {
          this[0x309] = (CTeamplayRoundBasedRules)0x1;
          (**(code **)(*(int *)this + 0x26c))(this,2,this[0x268],0);
        }
      }
      else {
LAB_004cdb06:
        (**(code **)(*(int *)this + 0x268))(this,local_24,6,1,0,1);
      }
    }
  }
                    /* WARNING: Could not recover jumptable at 0x004cda16. Too many branches */
                    /* WARNING: Treating indirect jump as call */
  (**(code **)(*(int *)this + 0x294))();
  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)