L L4D2node

CRotButton::Spawn

0x00636450 · 652 bytes · __thiscall

_ZN10CRotButton5SpawnEv

Decompiled

undefined (1 param)

/* CRotButton::Spawn() */

void __thiscall CRotButton::Spawn(CRotButton *this)

{
  float fVar1;
  code *pcVar2;
  char *pcVar3;
  char *local_20 [4];
  
  if (*(int *)(this + 0x4f8) == 0) {
    *(undefined4 *)(this + 0x504) = 0;
  }
  else {
    MakeButtonSound((int)local_20);
    *(char **)(this + 0x504) = local_20[0];
    pcVar3 = "";
    if (local_20[0] != (char *)0x0) {
      pcVar3 = local_20[0];
    }
    CBaseEntity::PrecacheScriptSound(pcVar3);
  }
  CBaseToggle::AxisDir((CBaseToggle *)this);
  if (((byte)this[0x148] & 2) != 0) {
    *(uint *)(this + 0x470) = *(uint *)(this + 0x470) ^ 0x80000000;
    *(uint *)(this + 0x474) = *(uint *)(this + 0x474) ^ 0x80000000;
    *(uint *)(this + 0x46c) = *(uint *)(this + 0x46c) ^ 0x80000000;
  }
  CBaseEntity::SetMoveType((CBaseEntity *)this,7,0);
  CCollisionProperty::SetSolid((CCollisionProperty *)(this + 0x194),6);
  if (((byte)this[0x148] & 1) != 0) {
    *(uint *)(this + 0x14c) = *(uint *)(this + 0x14c) | 0x40000;
    CCollisionProperty::SetSolidFlags
              ((CCollisionProperty *)(this + 0x194),(uint)(*(ushort *)(this + 0x1b4) | 4));
  }
  pcVar2 = *(code **)(*(int *)this + 0x70);
  (**(code **)(*(int *)this + 0x20))(local_20,this);
  pcVar3 = "";
  if (local_20[0] != (char *)0x0) {
    pcVar3 = local_20[0];
  }
  (*pcVar2)(this,pcVar3);
  if (*(float *)(this + 0x11c) == 0.0) {
    *(undefined4 *)(this + 0x11c) = 0x42200000;
  }
  if (*(float *)(this + 0x448) == 0.0) {
    *(undefined4 *)(this + 0x448) = 0x3f800000;
  }
  if ((0 < *(int *)(this + 0x100)) && (this[0x105] != (CRotButton)0x2)) {
    (**(code **)(*(int *)this + 0x224))(this,this + 0x105);
    this[0x105] = (CRotButton)0x2;
  }
  fVar1 = *(float *)(this + 0x444);
  this[0x4c5] = (CRotButton)0x1;
  *(undefined4 *)(this + 0x440) = 1;
  *(code **)(this + 0xe0) = CBaseButton::ButtonUse;
  *(undefined4 *)(this + 0xe4) = 0;
  *(float *)(this + 0x47c) = *(float *)(this + 0x3ac);
  *(float *)(this + 0x480) = *(float *)(this + 0x3b0);
  *(float *)(this + 0x478) = *(float *)(this + 0x3a8);
  *(float *)(this + 0x488) = *(float *)(this + 0x470) * fVar1 + *(float *)(this + 0x3ac);
  *(float *)(this + 0x48c) = *(float *)(this + 0x474) * fVar1 + *(float *)(this + 0x3b0);
  *(float *)(this + 0x484) = fVar1 * *(float *)(this + 0x46c) + *(float *)(this + 0x3a8);
  this[0x4c4] = (CRotButton)(*(float *)(this + 0x448) == -1.0);
  if (((byte)this[0x149] & 1) == 0) {
    *(undefined4 *)(this + 0xd8) = 0;
    *(undefined4 *)(this + 0xdc) = 0;
  }
  else {
    *(code **)(this + 0xd8) = CBaseButton::ButtonTouch;
    *(undefined4 *)(this + 0xdc) = 0;
  }
                    /* WARNING: Could not recover jumptable at 0x0063666a. Too many branches */
                    /* WARNING: Treating indirect jump as call */
  (**(code **)(*(int *)this + 0x290))();
  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)