L L4D2node

CBreakable::Precache

0x006b1a60 · 640 bytes · __thiscall

_ZN10CBreakable8PrecacheEv

Decompiled

undefined (1 param)

/* CBreakable::Precache() */

void __thiscall CBreakable::Precache(CBreakable *this)

{
  undefined4 *puVar1;
  float fVar2;
  char *pcVar3;
  int *piVar4;
  int iVar5;
  undefined4 uVar6;
  undefined1 *puVar7;
  char *pcVar8;
  int iVar9;
  double local_1c;
  double local_14;
  
  switch(*(undefined4 *)(this + 0x44c)) {
  case 0:
  case 7:
    pcVar8 = "GlassChunks";
    break;
  case 2:
    pcVar8 = "MetalChunks";
    break;
  default:
    if (((byte)this[0x14d] & 8) == 0) {
      local_14 = (double)*(float *)(this + 0x2e8);
LAB_006b1be3:
      local_1c = (double)*(float *)(this + 0x2e4);
    }
    else {
      CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
      local_14 = (double)*(float *)(this + 0x2e8);
      if (((byte)this[0x14d] & 8) == 0) goto LAB_006b1be3;
      CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
      local_1c = (double)*(float *)(this + 0x2e4);
      if (((byte)this[0x14d] & 8) != 0) {
        CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
      }
    }
    fVar2 = *(float *)(this + 0x2e0);
    uVar6 = CBaseEntity::GetDebugName((CBaseEntity *)this);
    puVar7 = &DAT_00d539c2;
    if (*(undefined1 **)(this + 0x7c) != (undefined1 *)0x0) {
      puVar7 = *(undefined1 **)(this + 0x7c);
    }
    Warning("%s (%s) at (%.3f %.3f %.3f) using obsolete or unknown material type.\n",puVar7,uVar6,
            (double)fVar2,local_1c,local_14);
  case 1:
    pcVar8 = "WoodChunks";
    break;
  case 4:
  case 8:
    pcVar8 = "ConcreteChunks";
  }
  pcVar3 = *(char **)(this + 0x464);
  if (*(char **)(this + 0x464) == (char *)0x0) {
    pcVar3 = pcVar8;
  }
  pcVar8 = (char *)0x0;
  if (*pcVar3 != '\0') {
    pcVar8 = pcVar3;
  }
  iVar9 = 0;
  *(char **)(this + 0x484) = pcVar8;
  piVar4 = (int *)CommandLine_Tier0();
  iVar5 = (**(code **)(*piVar4 + 0xc))(piVar4,"-makereslists",0);
  if (iVar5 == 0) {
    if (*(char **)(this + 0x468) != (char *)0x0) {
      UTIL_PrecacheOther(*(char **)(this + 0x468),(char *)0x0);
    }
  }
  else {
LAB_006b1ad8:
    do {
      if ((&pSpawnObjects)[iVar9] != 0) {
        iVar5 = _V_strlen("unused");
        iVar5 = V_strnicmp((char *)(&pSpawnObjects)[iVar9],"unused",iVar5);
        if (iVar5 != 0) {
          puVar1 = &pSpawnObjects + iVar9;
          iVar9 = iVar9 + 1;
          UTIL_PrecacheOther((char *)*puVar1,(char *)0x0);
          if (iVar9 == 0x1b) break;
          goto LAB_006b1ad8;
        }
      }
      iVar9 = iVar9 + 1;
    } while (iVar9 != 0x1b);
  }
  CBaseEntity::PrecacheScriptSound("Breakable.MatGlass");
  CBaseEntity::PrecacheScriptSound("Breakable.MatWood");
  CBaseEntity::PrecacheScriptSound("Breakable.MatMetal");
  CBaseEntity::PrecacheScriptSound("Breakable.MatFlesh");
  CBaseEntity::PrecacheScriptSound("Breakable.MatConcrete");
  CBaseEntity::PrecacheScriptSound("Breakable.Computer");
  CBaseEntity::PrecacheScriptSound("Breakable.Crate");
  CBaseEntity::PrecacheScriptSound("Breakable.Glass");
  CBaseEntity::PrecacheScriptSound("Breakable.Metal");
  CBaseEntity::PrecacheScriptSound("Breakable.Flesh");
  CBaseEntity::PrecacheScriptSound("Breakable.Concrete");
  CBaseEntity::PrecacheScriptSound("Breakable.Ceiling");
  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)