L L4D2node

CBreakableSurface::InputShatter

0x006ba360 · 853 bytes · __thiscall

_ZN17CBreakableSurface12InputShatterER11inputdata_t

Decompiled

undefined (2 params)

/* CBreakableSurface::InputShatter(inputdata_t&) */

void __thiscall CBreakableSurface::InputShatter(CBreakableSurface *this,inputdata_t *param_1)

{
  float fVar1;
  float fVar2;
  float fVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  int iVar8;
  int iVar9;
  float fVar10;
  float fVar11;
  float fVar12;
  float fVar13;
  float fVar14;
  float fVar15;
  float fVar16;
  CBreakableSurface *in_stack_ffffff64;
  CBaseEntity *in_stack_ffffff68;
  Vector *in_stack_ffffff6c;
  QAngle local_58 [12];
  float local_4c;
  float local_48;
  float local_44;
  float local_40;
  float local_3c;
  float local_38;
  float local_34;
  float local_30;
  float local_2c;
  float local_28;
  float local_24;
  float local_20;
  
  if ((*(int *)(param_1 + 0x18) == 0xf) ||
     (fVar10 = vec3_origin, fVar13 = DAT_01053d50, fVar11 = DAT_01053d4c,
     *(int *)(param_1 + 0x18) == 3)) {
    fVar10 = *(float *)(param_1 + 8);
    fVar13 = *(float *)(param_1 + 0x10);
    fVar11 = *(float *)(param_1 + 0xc);
  }
  if (this[0x524] == (CBreakableSurface)0x0) {
    Die(in_stack_ffffff64,in_stack_ffffff68,in_stack_ffffff6c);
  }
  iVar6 = *(int *)(this + 0x4fc);
  iVar4 = *(int *)(this + 0x500);
  fVar10 = (float)iVar6 * fVar10;
  fVar11 = (float)iVar4 * fVar11;
  iVar5 = (int)(fVar10 - fVar13 / *(float *)(this + 0x504));
  iVar8 = (int)(fVar13 / *(float *)(this + 0x504) + fVar10) + 1;
  if (iVar5 < 0) {
    iVar5 = 0;
  }
  if (iVar8 <= iVar6) {
    iVar6 = iVar8;
  }
  iVar9 = (int)(fVar11 - fVar13 / *(float *)(this + 0x508));
  local_28 = (float)(*(uint *)(this + 0x50c) ^ 0x80000000);
  local_24 = (float)(*(uint *)(this + 0x510) ^ 0x80000000);
  iVar7 = (int)(fVar13 / *(float *)(this + 0x508) + fVar11) + 1;
  iVar8 = 0;
  if (-1 < iVar9) {
    iVar8 = iVar9;
  }
  local_20 = (float)(*(uint *)(this + 0x514) ^ 0x80000000);
  if (iVar7 <= iVar4) {
    iVar4 = iVar7;
  }
  VectorAngles((Vector *)&local_28,local_58);
  AngleVectors(local_58,(Vector *)0x0,(Vector *)&local_4c,(Vector *)&local_40);
  fVar1 = *(float *)(this + 0x504);
  fVar2 = *(float *)(this + 0x508);
  if (iVar5 < iVar6) {
    do {
      if (iVar8 < iVar4) {
        fVar16 = (float)iVar5;
        iVar7 = iVar8;
        do {
          while( true ) {
            fVar12 = (float)iVar7;
            fVar3 = *(float *)(this + 0x504);
            fVar15 = (fVar16 + 0.5) * fVar3 - fVar10 * fVar1;
            fVar14 = (fVar12 + 0.5) * fVar3 - fVar11 * fVar2;
            if (fVar13 * fVar13 < fVar14 * fVar14 + fVar15 * fVar15) break;
            fVar14 = *(float *)(this + 0x508);
            local_34 = fVar3 * local_4c * fVar16 + *(float *)(this + 0x518) +
                       fVar14 * local_40 * fVar12;
            local_30 = local_48 * fVar3 * fVar16 + *(float *)(this + 0x51c) +
                       local_3c * fVar14 * fVar12;
            local_2c = local_44 * fVar3 * fVar16 + *(float *)(this + 0x520) +
                       local_38 * fVar14 * fVar12;
            local_28 = *(float *)(this + 0x50c) * 500.0;
            local_24 = *(float *)(this + 0x510) * 500.0;
            local_20 = *(float *)(this + 0x514) * 500.0;
            iVar9 = iVar7 + 1;
            ShatterPane(this,iVar5,iVar7,(Vector *)&local_28,(Vector *)&local_34);
            iVar7 = iVar9;
            if (iVar9 == iVar4) goto LAB_006ba687;
          }
          iVar7 = iVar7 + 1;
        } while (iVar7 != iVar4);
      }
LAB_006ba687:
      iVar5 = iVar5 + 1;
    } while (iVar5 != iVar6);
  }
  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)