L L4D2node

CCSPlayer::State_Enter

0x00659e90 · 388 bytes · __thiscall

_ZN9CCSPlayer11State_EnterE13CSPlayerState

Decompiled

undefined (2 params)

/* CCSPlayer::State_Enter(CSPlayerState) */

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

{
  CBaseEdict *this_00;
  code *UNRECOVERED_JUMPTABLE;
  int iVar1;
  undefined4 *puVar2;
  longdouble lVar3;
  
  if (*(int *)(this + 0x23bc) != param_2) {
    if (this[0x6c] == (CCSPlayer)0x0) {
      this_00 = *(CBaseEdict **)(this + 0x30);
      if (this_00 != (CBaseEdict *)0x0) {
        *(uint *)this_00 = *(uint *)this_00 | 0x101;
        iVar1 = CBaseEdict::GetChangeAccessor(this_00);
        *(undefined2 *)(iVar1 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CCSPlayer)((byte)this[0x70] | 1);
    }
    *(int *)(this + 0x23bc) = param_2;
  }
  if (State_LookupInfo(CSPlayerState)::playerStateInfos == param_2) {
    iVar1 = 0;
LAB_0065a000:
    puVar2 = &State_LookupInfo(CSPlayerState)::playerStateInfos + iVar1 * 8;
  }
  else {
    iVar1 = 1;
    do {
      if ((&State_LookupInfo(CSPlayerState)::playerStateInfos)[iVar1 * 8] == param_2)
      goto LAB_0065a000;
      iVar1 = iVar1 + 1;
    } while (iVar1 != 10);
    puVar2 = (undefined4 *)0x0;
  }
  *(undefined4 **)(this + 0x23c8) = puVar2;
  lVar3 = (longdouble)IntervalTimer::Now();
  if ((float)lVar3 != *(float *)(this + 0x23c4)) {
    (**(code **)(*(int *)(this + 0x23c0) + 4))(this + 0x23c0,this + 0x23c4);
    *(float *)(this + 0x23c4) = (float)lVar3;
  }
  if (*(int *)(cs_ShowStateTransitions._28_4_ + 0x30) == -1) {
LAB_00659fc8:
    if (*(int *)(this + 0x23c8) != 0) {
      Msg("ShowStateTransitions: entering \'%s\'\n",*(undefined4 *)(*(int *)(this + 0x23c8) + 4));
      iVar1 = *(int *)(this + 0x23c8);
      goto joined_r0x00659fed;
    }
    Msg("ShowStateTransitions: entering #%d\n",param_2);
  }
  else {
    if (*(int *)(this + 0x30) == 0) {
      iVar1 = 0;
    }
    else {
      iVar1 = *(int *)(this + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
    }
    if (*(int *)(cs_ShowStateTransitions._28_4_ + 0x30) == iVar1) goto LAB_00659fc8;
  }
  iVar1 = *(int *)(this + 0x23c8);
joined_r0x00659fed:
  if ((iVar1 != 0) &&
     (UNRECOVERED_JUMPTABLE = *(code **)(iVar1 + 8), UNRECOVERED_JUMPTABLE != (code *)0x0)) {
    if (((uint)UNRECOVERED_JUMPTABLE & 1) != 0) {
                    /* WARNING: Could not recover jumptable at 0x00659fb0. Too many branches */
                    /* WARNING: Treating indirect jump as call */
      (**(code **)(UNRECOVERED_JUMPTABLE + *(int *)(this + *(int *)(iVar1 + 0xc)) + -1))();
      return;
    }
                    /* WARNING: Could not recover jumptable at 0x00659f96. Too many branches */
                    /* WARNING: Treating indirect jump as call */
    (*UNRECOVERED_JUMPTABLE)();
    return;
  }
  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)