L L4D2node

CPhysicsCannister::Spawn

0x00787550 · 538 bytes · __thiscall

_ZN17CPhysicsCannister5SpawnEv

Decompiled

undefined (1 param)

/* CPhysicsCannister::Spawn() */

void __thiscall CPhysicsCannister::Spawn(CPhysicsCannister *this)

{
  float fVar1;
  code *pcVar2;
  CBaseEdict *pCVar3;
  undefined1 *puVar4;
  int iVar5;
  undefined1 *local_10;
  
  (**(code **)(*(int *)this + 0x6c))(this);
  pcVar2 = *(code **)(*(int *)this + 0x70);
  (**(code **)(*(int *)this + 0x20))(&local_10,this);
  puVar4 = &DAT_00d539c2;
  if (local_10 != (undefined1 *)0x0) {
    puVar4 = local_10;
  }
  (*pcVar2)(this,puVar4);
  CBaseCombatCharacter::SetBloodColor((CBaseCombatCharacter *)this,-1);
  CCollisionProperty::SetSolidFlags
            ((CCollisionProperty *)(this + 0x194),(uint)(*(ushort *)(this + 0x1b4) | 1));
  if (this[0x105] != (CPhysicsCannister)0x2) {
    (**(code **)(*(int *)this + 0x224))(this,this + 0x105);
    this[0x105] = (CPhysicsCannister)0x2;
  }
  CBaseEntity::SetNextThink((CBaseEntity *)this,-1.0,(char *)0x0);
  if (*(int *)(this + 0x100) < 1) {
    (**(code **)(*(int *)this + 0x214))(this,this + 0x100);
    *(undefined4 *)(this + 0x100) = 0x19;
  }
  fVar1 = *(float *)(gpGlobals + 0xc);
  if (fVar1 == *(float *)(this + 0x90)) {
    fVar1 = *(float *)(this + 0x468);
  }
  else {
    if (this[0x6c] == (CPhysicsCannister)0x0) {
      pCVar3 = *(CBaseEdict **)(this + 0x30);
      if (pCVar3 != (CBaseEdict *)0x0) {
        *(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
        iVar5 = CBaseEdict::GetChangeAccessor(pCVar3);
        *(undefined2 *)(iVar5 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CPhysicsCannister)((byte)this[0x70] | 1);
    }
    *(float *)(this + 0x90) = fVar1;
    fVar1 = *(float *)(this + 0x468);
  }
  if (fVar1 == 0.0) {
    fVar1 = *(float *)(this + 0x490);
  }
  else {
    if (this[0x6c] == (CPhysicsCannister)0x0) {
      pCVar3 = *(CBaseEdict **)(this + 0x30);
      if (pCVar3 != (CBaseEdict *)0x0) {
        *(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
        iVar5 = CBaseEdict::GetChangeAccessor(pCVar3);
        *(undefined2 *)(iVar5 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CPhysicsCannister)((byte)this[0x70] | 1);
    }
    fVar1 = *(float *)(this + 0x490);
    *(undefined4 *)(this + 0x468) = 0;
  }
  if (fVar1 != 0.0) {
    if (this[0x6c] == (CPhysicsCannister)0x0) {
      pCVar3 = *(CBaseEdict **)(this + 0x30);
      if (pCVar3 != (CBaseEdict *)0x0) {
        *(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
        iVar5 = CBaseEdict::GetChangeAccessor(pCVar3);
        *(undefined2 *)(iVar5 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CPhysicsCannister)((byte)this[0x70] | 1);
    }
    *(undefined4 *)(this + 0x490) = 0;
  }
  this[0x1a8c] = (CPhysicsCannister)0x0;
  this[0x1a74] = (CPhysicsCannister)0x0;
  (**(code **)(*(int *)this + 0x290))(this);
  if (*(int *)(this + 0x238) != 0) {
    return;
  }
  UTIL_Remove((CBaseEntity *)this);
  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)