L L4D2node

CTeamplayRoundBasedRules::State_Enter_PREROUND

0x004cd5d0 · 961 bytes · __thiscall

_ZN24CTeamplayRoundBasedRules20State_Enter_PREROUNDEv

Decompiled

undefined (1 param)

/* CTeamplayRoundBasedRules::State_Enter_PREROUND() */

void __thiscall CTeamplayRoundBasedRules::State_Enter_PREROUND(CTeamplayRoundBasedRules *this)

{
  uint uVar1;
  undefined4 uVar2;
  char cVar3;
  int *piVar4;
  int iVar5;
  uint *puVar6;
  undefined4 *puVar7;
  undefined *puVar8;
  uint uVar9;
  undefined4 local_30 [3];
  undefined4 local_24;
  undefined4 local_20;
  
  BalanceTeams(this,false);
  *(float *)(this + 0x458) = *(float *)(gpGlobals + 0xc) + 60.0;
  (**(code **)(*(int *)this + 0x2fc))(this);
  piVar4 = (int *)(**(code **)(*gameeventmanager + 0x1c))
                            (gameeventmanager,"teamplay_round_start",0,0);
  if (piVar4 != (int *)0x0) {
    (**(code **)(*piVar4 + 0x2c))(piVar4,"full_reset",this[0x268]);
    (**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar4,0);
  }
  cVar3 = (**(code **)(*(int *)this + 0x29c))(this);
  if (cVar3 == '\0') {
    *(float *)(this + 0x244) =
         *(float *)(mp_enableroundwaittime._28_4_ + 0x2c) * 5.0 + *(float *)(gpGlobals + 0xc);
    goto LAB_004cd6a3;
  }
  iVar5 = (**(code **)(*(int *)this + 0x2f8))(this);
  if (0 < iVar5) {
    uVar1 = *(uint *)(this + 0x25c);
    if (uVar1 == 0xffffffff) {
LAB_004cd704:
      piVar4 = (int *)CBaseEntity::Create("team_round_timer",(Vector *)&vec3_origin,
                                          (QAngle *)&vec3_angle,(CBaseEntity *)0x0);
      if (piVar4 == (int *)0x0) {
        *(undefined4 *)(this + 0x25c) = 0xffffffff;
      }
      else {
        puVar6 = (uint *)(**(code **)(*piVar4 + 0xc))(piVar4);
        puVar8 = g_pEntityList;
        uVar1 = *puVar6;
        *(uint *)(this + 0x25c) = uVar1;
        if (((uVar1 != 0xffffffff) &&
            (puVar7 = (undefined4 *)(puVar8 + (uVar1 & 0xfff) * 0x10 + 4),
            puVar7 != (undefined4 *)0x0)) && (puVar7[1] == uVar1 >> 0xc)) goto LAB_004cd97d;
      }
      piVar4 = (int *)0x0;
    }
    else {
      uVar9 = uVar1 & 0xfff;
      puVar7 = (undefined4 *)(g_pEntityList + uVar9 * 0x10 + 4);
      if (((puVar7 == (undefined4 *)0x0) ||
          (*(uint *)(g_pEntityList + uVar9 * 0x10 + 8) != uVar1 >> 0xc)) ||
         (*(int *)(g_pEntityList + uVar9 * 0x10 + 4) == 0)) goto LAB_004cd704;
LAB_004cd97d:
      piVar4 = (int *)*puVar7;
    }
    (**(code **)(*piVar4 + 0x84))(piVar4,"show_in_hud",&DAT_00cbe2d5);
    piVar4 = (int *)0x0;
    uVar2 = *(undefined4 *)(tf_arena_preround_time._28_4_ + 0x30);
    uVar1 = *(uint *)(this + 0x25c);
    if (((uVar1 != 0xffffffff) &&
        (puVar8 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
       (*(uint *)(puVar8 + 8) == uVar1 >> 0xc)) {
      piVar4 = *(int **)(puVar8 + 4);
    }
    local_24 = 0xffffffff;
    local_20 = 5;
    local_30[0] = uVar2;
    (**(code **)(*piVar4 + 0xb4))(piVar4,"SetTime",0,0,local_30,0);
    uVar1 = *(uint *)(this + 0x25c);
    piVar4 = (int *)0x0;
    if (((uVar1 != 0xffffffff) &&
        (puVar8 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
       (*(uint *)(puVar8 + 8) == uVar1 >> 0xc)) {
      piVar4 = *(int **)(puVar8 + 4);
    }
    local_24 = 0xffffffff;
    local_20 = 5;
    local_30[0] = uVar2;
    (**(code **)(*piVar4 + 0xb4))(piVar4,"Resume",0,0,local_30,0);
    uVar1 = *(uint *)(this + 0x25c);
    piVar4 = (int *)0x0;
    if (((uVar1 != 0xffffffff) &&
        (puVar8 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
       (*(uint *)(puVar8 + 8) == uVar1 >> 0xc)) {
      piVar4 = *(int **)(puVar8 + 4);
    }
    local_24 = 0xffffffff;
    local_20 = 5;
    local_30[0] = uVar2;
    (**(code **)(*piVar4 + 0xb4))(piVar4,"Enable",0,0,local_30,0);
    iVar5 = (**(code **)(*gameeventmanager + 0x1c))(gameeventmanager,"teamplay_update_timer",0,0);
    if (iVar5 != 0) {
      (**(code **)(*gameeventmanager + 0x20))(gameeventmanager,iVar5,0);
    }
  }
  *(float *)(this + 0x244) =
       (float)*(int *)(tf_arena_preround_time._28_4_ + 0x30) + *(float *)(gpGlobals + 0xc);
LAB_004cd6a3:
  (**(code **)(*(int *)this + 0x294))(this);
  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)