L L4D2node

CBreakableSurface::BreakThink

0x006b8ef0 · 551 bytes · __thiscall

_ZN17CBreakableSurface10BreakThinkEv

Decompiled

undefined (1 param)

/* CBreakableSurface::BreakThink() */

void __thiscall CBreakableSurface::BreakThink(CBreakableSurface *this)

{
  int iVar1;
  char cVar2;
  int iVar3;
  int iVar4;
  int iVar5;
  longdouble lVar6;
  undefined1 *local_428;
  CBreakableSurface *local_424;
  undefined1 *local_420;
  undefined1 local_41c [1036];
  
  if ((*(int *)(this + 0x528) != 1) && (iVar1 = *(int *)(this + 0x4fc), 0 < iVar1)) {
    iVar4 = *(int *)(this + 0x500);
    local_428 = local_41c;
    iVar3 = 0;
    do {
      if (0 < iVar4) {
        iVar5 = 0;
        do {
          cVar2 = IsBroken(this,iVar3,iVar5);
          if (cVar2 == '\0') {
            lVar6 = (longdouble)RecalcSupport(this,iVar3,iVar5);
            *(float *)(local_428 + iVar5 * 4) = (float)lVar6;
          }
          iVar5 = iVar5 + 1;
        } while (iVar5 != iVar4);
      }
      local_428 = local_428 + 0x40;
      iVar3 = iVar3 + 1;
    } while (iVar3 != iVar1);
    iVar1 = *(int *)(this + 0x930);
    local_420 = local_41c;
    iVar4 = 0;
    local_424 = this;
    do {
      if (0 < *(int *)(this + 0x500)) {
        iVar3 = 0;
        do {
          while ((cVar2 = IsBroken(this,iVar4,iVar3), cVar2 != '\0' ||
                 (SetSupport(this,iVar4,iVar3,*(float *)(local_420 + iVar3 * 4) * 0.14814815),
                 (float)iVar1 * 0.002 < *(float *)(local_424 + iVar3 * 4 + 0x530) ||
                 (float)iVar1 * 0.002 == *(float *)(local_424 + iVar3 * 4 + 0x530)))) {
            iVar3 = iVar3 + 1;
            if (*(int *)(this + 0x500) <= iVar3) goto LAB_006b90d0;
          }
          iVar5 = (**(code **)(*random_valve + 8))(random_valve,0,1);
          if (iVar5 == 0) {
            ShatterPane(this,iVar4,iVar3,(Vector *)&vec3_origin,(Vector *)&vec3_origin);
          }
          else {
            DropPane(this,iVar4,iVar3);
          }
          iVar3 = iVar3 + 1;
          CBaseEntity::SetNextThink((CBaseEntity *)this,*(float *)(gpGlobals + 0xc),(char *)0x0);
        } while (iVar3 < *(int *)(this + 0x500));
      }
LAB_006b90d0:
      local_420 = local_420 + 0x40;
      iVar4 = iVar4 + 1;
      local_424 = local_424 + 0x40;
    } while (iVar4 < *(int *)(this + 0x4fc));
  }
  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)