L L4D2node

CTeamplayRoundBasedRules::State_Enter

0x004ca3e0 · 224 bytes · __thiscall

_ZN24CTeamplayRoundBasedRules11State_EnterE22gamerules_roundstate_t

Decompiled

undefined (2 params)

/* CTeamplayRoundBasedRules::State_Enter(gamerules_roundstate_t) */

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

{
  undefined4 uVar1;
  int iVar2;
  undefined4 *puVar3;
  code *UNRECOVERED_JUMPTABLE;
  
  if (*(int *)(this + 0x318) != param_2) {
    CGameRulesProxy::NotifyNetworkStateChanged();
    *(int *)(this + 0x318) = param_2;
  }
  uVar1 = mp_showroundtransitions._28_4_;
  if (State_LookupInfo(gamerules_roundstate_t)::playerStateInfos == param_2) {
    iVar2 = 0;
LAB_004ca468:
    puVar3 = &State_LookupInfo(gamerules_roundstate_t)::playerStateInfos + iVar2 * 8;
    *(undefined4 **)(this + 0x240) = puVar3;
    if (*(int *)(uVar1 + 0x30) < 1) goto LAB_004ca4a0;
    Msg("Gamerules: entering state \'%s\'\n",(&PTR_s_GR_STATE_INIT_00f1aae4)[iVar2 * 8]);
    puVar3 = *(undefined4 **)(this + 0x240);
  }
  else {
    iVar2 = 1;
    do {
      if ((&State_LookupInfo(gamerules_roundstate_t)::playerStateInfos)[iVar2 * 8] == param_2)
      goto LAB_004ca468;
      iVar2 = iVar2 + 1;
    } while (iVar2 != 9);
    *(undefined4 *)(this + 0x240) = 0;
    if (*(int *)(mp_showroundtransitions._28_4_ + 0x30) < 1) {
      return;
    }
    Msg("Gamerules: entering state #%d\n",param_2);
    puVar3 = *(undefined4 **)(this + 0x240);
  }
  if (puVar3 == (undefined4 *)0x0) {
    return;
  }
LAB_004ca4a0:
  UNRECOVERED_JUMPTABLE = (code *)puVar3[2];
  if (UNRECOVERED_JUMPTABLE == (code *)0x0) {
    return;
  }
  if (((uint)UNRECOVERED_JUMPTABLE & 1) != 0) {
    UNRECOVERED_JUMPTABLE = *(code **)(UNRECOVERED_JUMPTABLE + *(int *)(this + puVar3[3]) + -1);
  }
                    /* WARNING: Could not recover jumptable at 0x004ca4be. Too many branches */
                    /* WARNING: Treating indirect jump as call */
  (*UNRECOVERED_JUMPTABLE)();
  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)