L L4D2node

CBreakable::Spawn

0x006b2de0 · 994 bytes · __thiscall

_ZN10CBreakable5SpawnEv

Decompiled

undefined (1 param)

/* CBreakable::Spawn() */

void __thiscall CBreakable::Spawn(CBreakable *this)

{
  code *pcVar1;
  CBaseEdict *pCVar2;
  int *piVar3;
  undefined4 uVar4;
  undefined1 *puVar5;
  int iVar6;
  char *pcVar7;
  int iVar8;
  uint uVar9;
  undefined4 uVar10;
  undefined1 *local_10;
  
  uVar4 = func_breakdmg_club._28_4_;
  *(undefined4 *)(this + 0x4bc) = *(undefined4 *)(func_breakdmg_bullet._28_4_ + 0x2c);
  uVar10 = func_breakdmg_explosive._28_4_;
  *(undefined4 *)(this + 0x4c0) = *(undefined4 *)(uVar4 + 0x2c);
  uVar10 = *(undefined4 *)(uVar10 + 0x2c);
  *(undefined4 *)(this + 0x4c8) = 0x3f800000;
  *(undefined4 *)(this + 0x4c4) = uVar10;
  ParsePropData(this);
  (**(code **)(*(int *)this + 0x6c))(this);
  iVar6 = *(int *)(this + 0x100);
  if (iVar6 == 0) {
    if (*(int *)(this + 0x44c) == 0) {
LAB_006b2e58:
      (**(code **)(*(int *)this + 0x214))(this,this + 0x100);
      *(undefined4 *)(this + 0x100) = 1;
    }
LAB_006b2e77:
    if (this[0x105] == (CBreakable)0x0) {
LAB_006b2e84:
      iVar6 = *(int *)(this + 0x100);
    }
    else {
      (**(code **)(*(int *)this + 0x224))(this,this + 0x105);
      this[0x105] = (CBreakable)0x0;
      iVar6 = *(int *)(this + 0x100);
    }
  }
  else {
    if (((byte)this[0x148] & 1) != 0) {
      if ((*(int *)(this + 0x44c) == 0) && (iVar6 != 1)) goto LAB_006b2e58;
      goto LAB_006b2e77;
    }
    if (this[0x105] != (CBreakable)0x2) {
      (**(code **)(*(int *)this + 0x224))(this,this + 0x105);
      this[0x105] = (CBreakable)0x2;
      goto LAB_006b2e84;
    }
  }
  iVar8 = 1;
  if (0 < iVar6) {
    iVar8 = iVar6;
  }
  if (iVar8 != *(int *)(this + 0xfc)) {
    (**(code **)(*(int *)this + 0x20c))(this,this + 0xfc);
    *(int *)(this + 0xfc) = iVar8;
  }
  CCollisionProperty::SetSolid((CCollisionProperty *)(this + 0x194),1);
  CBaseEntity::SetMoveType((CBaseEntity *)this,7,0);
  *(undefined4 *)(this + 0x448) = *(undefined4 *)(this + 0x3ac);
  pcVar1 = *(code **)(*(int *)this + 0x70);
  (**(code **)(*(int *)this + 0x20))(&local_10,this);
  puVar5 = &DAT_00d539c2;
  if (local_10 != (undefined1 *)0x0) {
    puVar5 = local_10;
  }
  (*pcVar1)(this,puVar5);
  *(code **)(this + 0xd8) = BreakTouch;
  *(undefined4 *)(this + 0xdc) = 0;
  if (((byte)this[0x148] & 1) != 0) {
    *(undefined4 *)(this + 0xd8) = 0;
  }
  if ((*(int *)(this + 0x44c) == 7) && (this[0x121] != (CBreakable)0x0)) {
    CBaseEntity::AddFlag((CBaseEntity *)this,0x1000000);
  }
  if (*(float *)(this + 0x488) == 0.0) {
    *(undefined4 *)(this + 0x488) = 0x3f800000;
  }
  (**(code **)(*(int *)this + 0x290))(this);
  if (*(int *)(DebugZombieBreakables._28_4_ + 0x30) != 0) goto LAB_006b3108;
  if (*(int *)(this + 0x47c) == 2) {
LAB_006b30a8:
    uVar9 = *(uint *)(this + 0x148) | 0x1000;
    if (*(uint *)(this + 0x148) != uVar9) {
      if (this[0x6c] == (CBreakable)0x0) {
        pCVar2 = *(CBaseEdict **)(this + 0x30);
        if (pCVar2 != (CBaseEdict *)0x0) {
          *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
          iVar6 = CBaseEdict::GetChangeAccessor(pCVar2);
          *(undefined2 *)(iVar6 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CBreakable)((byte)this[0x70] | 1);
      }
      *(uint *)(this + 0x148) = uVar9;
    }
    iVar6 = *(int *)this;
    uVar10 = 0x11;
  }
  else {
    pcVar7 = *(char **)(this + 0x154);
    if (pcVar7 == (char *)0x0) {
      pcVar7 = "";
    }
    else if (pcVar7 == "hulk") goto LAB_006b30a8;
    iVar6 = _V_stricmp(pcVar7,"hulk");
    if (iVar6 == 0) goto LAB_006b30a8;
    pcVar7 = *(char **)(this + 0x154);
    if (pcVar7 == (char *)0x0) {
      pcVar7 = "";
    }
    else if (pcVar7 == "tank") goto LAB_006b30a8;
    iVar6 = _V_stricmp(pcVar7,"tank");
    if (iVar6 == 0) goto LAB_006b30a8;
    if (*(int *)(this + 0x47c) != 1) {
      pcVar7 = *(char **)(this + 0x154);
      if (pcVar7 == (char *)0x0) {
        pcVar7 = "";
      }
      else if (pcVar7 == "zombie") goto LAB_006b302a;
      iVar6 = _V_stricmp(pcVar7,"zombie");
      if (iVar6 != 0) goto LAB_006b3108;
    }
LAB_006b302a:
    uVar9 = *(uint *)(this + 0x148) | 0x2000;
    if (*(uint *)(this + 0x148) != uVar9) {
      if (this[0x6c] == (CBreakable)0x0) {
        pCVar2 = *(CBaseEdict **)(this + 0x30);
        if (pCVar2 != (CBaseEdict *)0x0) {
          *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
          iVar6 = CBaseEdict::GetChangeAccessor(pCVar2);
          *(undefined2 *)(iVar6 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CBreakable)((byte)this[0x70] | 1);
      }
      *(uint *)(this + 0x148) = uVar9;
    }
    iVar6 = *(int *)this;
    uVar10 = 0x12;
  }
  (**(code **)(iVar6 + 0x3a8))(this,uVar10);
  CBaseEntity::SetAIWalkable((CBaseEntity *)this,false);
LAB_006b3108:
  piVar3 = TheNavMesh;
  this[0x4f8] = (CBreakable)0x0;
  (**(code **)(*piVar3 + 0x54))(piVar3,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)