L L4D2node

CBreakableProp::HandleInteractionStick

0x007eb780 · 786 bytes · __thiscall

_ZN14CBreakableProp22HandleInteractionStickEiP21gamevcollisionevent_t

Decompiled

undefined (3 params)

/* CBreakableProp::HandleInteractionStick(int, gamevcollisionevent_t*) */

void __thiscall
CBreakableProp::HandleInteractionStick
          (CBreakableProp *this,int param_1,gamevcollisionevent_t *param_2)

{
  short sVar1;
  undefined4 *puVar2;
  float fVar3;
  float fVar4;
  float fVar5;
  char cVar6;
  int iVar7;
  CMemberFunctor3<CBreakableProp*,void(CBreakableProp::*)(Vector_const&,Vector_const&,QAngle_const&),Vector,Vector,QAngle,CRefCounted1<CFunctor,CRefCountServiceBase<true,CRefMT>>,CFuncMemPolicyNone>
  *this_00;
  undefined4 *puVar8;
  undefined4 *puVar9;
  bool bVar10;
  longdouble lVar11;
  float local_58;
  float local_54;
  float local_50;
  float local_4c;
  float local_48;
  float local_44;
  undefined4 local_40;
  undefined4 local_3c;
  undefined4 local_38;
  float local_34;
  float local_30;
  float local_2c;
  float local_28;
  float local_24;
  float local_20;
  
  local_58 = *(float *)(param_2 + param_1 * 0xc + 0x20);
  local_54 = *(float *)(param_2 + param_1 * 0xc + 0x24);
  local_50 = *(float *)(param_2 + param_1 * 0xc + 0x28);
  lVar11 = (longdouble)VectorNormalize((Vector *)&local_58);
  if (1000.0 < (float)lVar11) {
    (**(code **)(**(int **)(this + 0x238) + 0xc4))(*(int **)(this + 0x238),&local_4c,&local_40);
    (**(code **)**(undefined4 **)(param_2 + 0x1c))(*(undefined4 **)(param_2 + 0x1c),&local_34);
    if (param_1 == 1) {
      local_34 = -local_34;
      local_30 = -local_30;
      local_2c = -local_2c;
    }
    if (0.3 < local_30 * local_54 + local_34 * local_58 + local_2c * local_50) {
      iVar7 = (**(code **)(*physprops + 0x18))
                        (physprops,*(undefined4 *)(param_2 + (uint)(param_1 == 0) * 4 + 8));
      fVar5 = local_44;
      fVar4 = local_48;
      fVar3 = local_4c;
      sVar1 = *(short *)(iVar7 + 0x4c);
      if (((sVar1 != 0x4d) && (sVar1 != 0x47)) && (sVar1 != 0x58)) {
        local_28 = *(float *)(param_2 + param_1 * 0xc + 0x20);
        local_24 = *(float *)(param_2 + param_1 * 0xc + 0x24);
        local_20 = *(float *)(param_2 + param_1 * 0xc + 0x28);
        VectorNormalize((Vector *)&local_28);
        local_28 = local_28 * 8.0;
        local_24 = local_24 * 8.0;
        local_20 = local_20 * 8.0;
        local_4c = local_28 + local_4c;
        local_48 = local_24 + local_48;
        local_44 = local_20 + local_44;
        this_00 = ::operator_new(0x40);
        *(undefined ***)this_00 = &PTR_AddRef_00cc82c8;
        *(undefined **)(this_00 + 8) = &DAT_00cc82e4;
        *(undefined4 *)(this_00 + 0xc) = 1;
        *(code **)(this_00 + 0x10) = StickAtPosition;
        *(undefined4 *)(this_00 + 0x14) = 0;
        *(float *)(this_00 + 0x28) = fVar3;
        *(float *)(this_00 + 0x2c) = fVar4;
        *(float *)(this_00 + 0x30) = fVar5;
        *(CBreakableProp **)(this_00 + 0x18) = this;
        *(float *)(this_00 + 0x1c) = local_4c;
        *(float *)(this_00 + 0x20) = local_48;
        bVar10 = DAT_00fec500 == '\0';
        *(float *)(this_00 + 0x24) = local_44;
        *(undefined4 *)(this_00 + 0x34) = local_40;
        *(undefined4 *)(this_00 + 0x38) = local_3c;
        *(undefined4 *)(this_00 + 0x3c) = local_38;
        if (bVar10) {
          do {
            puVar8 = DAT_00fec4f8;
            if (DAT_00fec4f8 == (undefined4 *)0x0) {
              puVar8 = ::operator_new(8);
              puVar8[1] = this_00;
              goto LAB_007eba1f;
            }
            cVar6 = ThreadInterlockedAssignIf64
                              (&DAT_00fec4f8,*DAT_00fec4f8,DAT_00fec4fc + -1,DAT_00fec4f8,
                               DAT_00fec4fc);
          } while (cVar6 == '\0');
          puVar8[1] = this_00;
LAB_007eba1f:
          *puVar8 = &g_PostSimulationQueue;
          while( true ) {
            iVar7 = DAT_00fec4ec;
            puVar2 = DAT_00fec4e8;
            LOCK();
            puVar9 = (undefined4 *)*DAT_00fec4e8;
            if (puVar9 == &g_PostSimulationQueue) {
              *DAT_00fec4e8 = puVar8;
              puVar9 = &g_PostSimulationQueue;
            }
            UNLOCK();
            if (puVar9 == &g_PostSimulationQueue) break;
            ThreadInterlockedAssignIf64(&DAT_00fec4e8,*puVar2,iVar7 + 1,puVar2,iVar7);
          }
          ThreadInterlockedAssignIf64(&DAT_00fec4e8,puVar8,iVar7 + 1,puVar2,iVar7);
          LOCK();
          DAT_00fec4f0 = DAT_00fec4f0 + 1;
          UNLOCK();
        }
        else {
          CMemberFunctor3<CBreakableProp*,void(CBreakableProp::*)(Vector_const&,Vector_const&,QAngle_const&),Vector,Vector,QAngle,CRefCounted1<CFunctor,CRefCountServiceBase<true,CRefMT>>,CFuncMemPolicyNone>
          ::operator()(this_00);
          (**(code **)(*(int *)this_00 + 4))(this_00);
        }
      }
    }
  }
  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)