L L4D2node

CFuncTrackTrain::Spawn

0x00b09450 · 583 bytes · __thiscall

_ZN15CFuncTrackTrain5SpawnEv

Decompiled

undefined (1 param)

/* CFuncTrackTrain::Spawn() */

void __thiscall CFuncTrackTrain::Spawn(CFuncTrackTrain *this)

{
  CCollisionProperty *this_00;
  code *pcVar1;
  undefined1 *puVar2;
  uint uVar3;
  undefined4 *puVar4;
  float fVar5;
  undefined4 uVar6;
  undefined4 uVar7;
  undefined4 uVar8;
  undefined4 uVar9;
  undefined1 local_1c [12];
  undefined1 *local_10;
  
  if (*(float *)(this + 0x484) == 0.0) {
    if (*(float *)(this + 0x11c) == 0.0) {
      *(undefined4 *)(this + 0x484) = 0x42c80000;
    }
    else {
      *(float *)(this + 0x484) = *(float *)(this + 0x11c);
    }
  }
  if (*(int *)(this + 0x4a8) == 0) {
    *(undefined4 *)(this + 0x4a8) = 0x3c;
  }
  if (*(int *)(this + 0x4ac) == 0) {
    *(undefined4 *)(this + 0x4ac) = 200;
  }
  CBaseEntity::SetLocalVelocity((CBaseEntity *)this,(Vector *)&vec3_origin);
  CBaseEntity::SetLocalAngularVelocity((CBaseEntity *)this,(QAngle *)&vec3_angle);
  *(undefined4 *)(this + 0x488) = 0x3f800000;
  if (*(int *)(this + 0xf8) == 0) {
    uVar6 = CBaseEntity::GetDebugName((CBaseEntity *)this);
    Msg("FuncTrackTrain \'%s\' has no target.\n",uVar6);
  }
  pcVar1 = *(code **)(*(int *)this + 0x70);
  (**(code **)(*(int *)this + 0x20))(&local_10,this);
  puVar2 = &DAT_00d539c2;
  if (local_10 != (undefined1 *)0x0) {
    puVar2 = local_10;
  }
  (*pcVar1)(this,puVar2);
  this_00 = (CCollisionProperty *)(this + 0x194);
  CBaseEntity::SetMoveType((CBaseEntity *)this,7,0);
  CCollisionProperty::SetSolid(this_00,(-((*(uint *)(this + 0x148) & 0x80) == 0) & 5U) + 1);
  uVar3 = *(uint *)(this + 0x148);
  if ((uVar3 & 0x200) != 0) {
    CBaseEntity::AddFlag((CBaseEntity *)this,0x40000000);
    uVar3 = *(uint *)(this + 0x148);
  }
  if ((uVar3 & 8) != 0) {
    CCollisionProperty::SetSolidFlags(this_00,(uint)(*(ushort *)(this + 0x1b4) | 4));
  }
  puVar4 = (undefined4 *)(**(code **)(*(int *)(this + 0x194) + 4))(this_00);
  *(undefined4 *)(this + 0x448) = *puVar4;
  *(undefined4 *)(this + 0x44c) = puVar4[1];
  *(undefined4 *)(this + 0x450) = puVar4[2];
  puVar4 = (undefined4 *)(**(code **)(*(int *)(this + 0x194) + 8))(this_00);
  *(undefined4 *)(this + 0x454) = *puVar4;
  *(undefined4 *)(this + 0x458) = puVar4[1];
  *(float *)(this + 0x45c) = (float)puVar4[2] + 72.0;
  uVar9 = 0;
  uVar8 = 0;
  uVar7 = 0;
  CBaseEntity::ThinkSet((_func_void *)local_1c,(float)this,(char *)Find);
  uVar6 = 0;
  fVar5 = *(float *)(gpGlobals + 0xc);
  CBaseEntity::SetNextThink((CBaseEntity *)this,fVar5,(char *)0x0);
  (**(code **)(*(int *)this + 0x6c))(this,fVar5,uVar6,uVar7,uVar8,uVar9);
                    /* WARNING: Could not recover jumptable at 0x00b09650. 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)