L L4D2node

CFuncRotating::Spawn

0x00630660 · 895 bytes · __thiscall

_ZN13CFuncRotating5SpawnEv

Decompiled

undefined (1 param)

/* CFuncRotating::Spawn() */

void __thiscall CFuncRotating::Spawn(CFuncRotating *this)

{
  CCollisionProperty *this_00;
  code *pcVar1;
  uint uVar2;
  undefined1 *puVar3;
  CFuncRotating *pCVar4;
  undefined4 uVar5;
  undefined1 local_2c [12];
  undefined1 *local_20 [4];
  
  if (*(float *)(this + 0x454) == 0.0) {
    *(undefined4 *)(this + 0x454) = 0x3f800000;
  }
  uVar2 = *(uint *)(this + 0x148);
  if ((uVar2 & 0x80) == 0) {
    if ((uVar2 & 0x100) == 0) {
      *(undefined4 *)(this + 0x450) = 0x3f4ccccd;
    }
    else {
      *(undefined4 *)(this + 0x450) = 0x3fa00000;
    }
  }
  else {
    *(undefined4 *)(this + 0x450) = 0x40000000;
  }
  if (*(float *)(this + 0x44c) == 0.0) {
    *(undefined4 *)(this + 0x44c) = 0x3f800000;
  }
  if ((uVar2 & 4) == 0) {
    if ((uVar2 & 8) == 0) {
      *(undefined4 *)(this + 0x440) = 0;
      *(undefined4 *)(this + 0x444) = 0x3f800000;
      *(undefined4 *)(this + 0x448) = 0;
    }
    else {
      *(undefined4 *)(this + 0x440) = 0x3f800000;
      *(undefined4 *)(this + 0x444) = 0;
      *(undefined4 *)(this + 0x448) = 0;
    }
  }
  else {
    *(undefined4 *)(this + 0x440) = 0;
    *(undefined4 *)(this + 0x444) = 0;
    *(undefined4 *)(this + 0x448) = 0x3f800000;
  }
  if ((uVar2 & 2) != 0) {
    *(uint *)(this + 0x444) = *(uint *)(this + 0x444) ^ 0x80000000;
    *(uint *)(this + 0x448) = *(uint *)(this + 0x448) ^ 0x80000000;
    *(uint *)(this + 0x440) = *(uint *)(this + 0x440) ^ 0x80000000;
  }
  this_00 = (CCollisionProperty *)(this + 0x194);
  CCollisionProperty::SetSolid(this_00,6);
  if (((byte)this[0x148] & 0x40) == 0) {
    uVar2 = *(ushort *)(this + 0x1b4) & 0xfffffffb;
  }
  else {
    uVar2 = (uint)(*(ushort *)(this + 0x1b4) | 4);
  }
  CCollisionProperty::SetSolidFlags(this_00,uVar2);
  uVar5 = 0;
  CBaseEntity::SetMoveType((CBaseEntity *)this,7,0);
  pcVar1 = *(code **)(*(int *)this + 0x70);
  pCVar4 = this;
  (**(code **)(*(int *)this + 0x20))(local_20,this);
  puVar3 = &DAT_00d539c2;
  if (local_20[0] != (undefined1 *)0x0) {
    puVar3 = local_20[0];
  }
  (*pcVar1)(this,puVar3);
  *(code **)(this + 0xe0) = RotatingUse;
  *(undefined4 *)(this + 0xe4) = 0;
  if (ABS(*(float *)(this + 0x45c)) == 0.0) {
    *(undefined4 *)(this + 0x45c) = 0x42c80000;
    uVar2 = *(uint *)(this + 0x148);
  }
  else {
    uVar2 = *(uint *)(this + 0x148);
    *(float *)(this + 0x45c) = ABS(*(float *)(this + 0x45c));
  }
  if ((uVar2 & 1) != 0) {
    uVar5 = 0;
    CBaseEntity::ThinkSet((_func_void *)local_2c,(float)this,(char *)CBaseEntity::SUB_CallUseToggle)
    ;
    pCVar4 = (CFuncRotating *)0x0;
    puVar3 = (undefined1 *)(*(float *)(gpGlobals + 0xc) + 0.2);
    CBaseEntity::SetNextThink((CBaseEntity *)this,(float)puVar3,(char *)0x0);
    uVar2 = *(uint *)(this + 0x148);
  }
  if ((uVar2 & 0x20) != 0) {
    *(code **)(this + 0xd8) = HurtTouch;
    *(undefined4 *)(this + 0xdc) = 0;
  }
  *(undefined4 *)(this + 0x11c) = 0;
  (**(code **)(*(int *)this + 0x6c))(this,puVar3,pCVar4,uVar5);
  (**(code **)(*(int *)this + 0x290))(this);
  *(undefined4 *)(this + 0x46c) = *(undefined4 *)(this + 0x3a8);
  *(undefined4 *)(this + 0x470) = *(undefined4 *)(this + 0x3ac);
  *(undefined4 *)(this + 0x474) = *(undefined4 *)(this + 0x3b0);
  if (this[0x479] != (CFuncRotating)0x0) {
    CCollisionProperty::SetSolid(this_00,1);
  }
  if (((byte)this[0x149] & 4) != 0) {
    *(undefined4 *)(this + 0x47c) = *(undefined4 *)(this + 0x39c);
    *(undefined4 *)(this + 0x480) = *(undefined4 *)(this + 0x3a0);
    *(undefined4 *)(this + 0x484) = *(undefined4 *)(this + 0x3a4);
    *(undefined4 *)(this + 0x488) = *(undefined4 *)(this + 0x3a8);
    *(undefined4 *)(this + 0x48c) = *(undefined4 *)(this + 0x3ac);
    *(undefined4 *)(this + 0x490) = *(undefined4 *)(this + 0x3b0);
  }
  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)