L L4D2node

CBreakableProp::HandleFirstCollisionInteractions

0x007fa480 · 1208 bytes · __thiscall

_ZN14CBreakableProp32HandleFirstCollisionInteractionsEiP21gamevcollisionevent_t

Decompiled

undefined (3 params)

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

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

{
  int iVar1;
  char cVar2;
  undefined4 *puVar3;
  int iVar4;
  undefined4 local_f4;
  undefined4 local_f0;
  undefined4 local_ec;
  float local_e8;
  float local_e4;
  float local_e0;
  undefined4 local_dc;
  undefined4 local_d8;
  undefined4 local_d4;
  undefined4 local_cc;
  undefined4 local_c8;
  undefined4 local_c4;
  float local_bc;
  float local_b8;
  float local_b4;
  undefined4 local_ac;
  undefined4 local_a8;
  undefined4 local_a4;
  undefined4 local_9c;
  undefined4 local_98;
  undefined4 local_94;
  undefined4 local_8c;
  undefined1 local_88;
  undefined1 local_87;
  int local_7c;
  undefined4 local_78;
  undefined4 local_74;
  int local_70;
  int local_6c;
  undefined4 local_68;
  undefined4 local_4c;
  undefined4 local_48;
  float local_40;
  undefined4 local_34;
  int local_30;
  
  if ((*(int *)(param_2 + ((param_1 == 0) + 0x18) * 4 + 8) == g_WorldEntity) &&
     (cVar2 = (**(code **)(*(int *)this + 0x440))(this,0), cVar2 != '\0')) {
    HandleInteractionStick(this,param_1,param_2);
  }
  cVar2 = (**(code **)(*(int *)this + 0x440))(this,1);
  if (cVar2 != '\0') {
    CTakeDamageInfo::CTakeDamageInfo((CTakeDamageInfo *)&local_7c);
    local_40 = (float)*(int *)(this + 0x100);
    puVar3 = (undefined4 *)(**(code **)(*(int *)this + 0xc))(this);
    local_48 = *puVar3;
    puVar3 = (undefined4 *)(**(code **)(*(int *)this + 0xc))(this);
    local_4c = *puVar3;
    local_34 = 0;
    (**(code **)(**(int **)(this + 0x238) + 0xd4))(*(int **)(this + 0x238),&local_cc,0);
    (**(code **)(**(int **)(this + 0x238) + 0xc4))(*(int **)(this + 0x238),&local_dc,0);
    local_7c = local_cc;
    local_78 = local_c8;
    local_74 = local_c4;
    local_70 = local_dc;
    local_6c = local_d8;
    local_68 = local_d4;
    CBaseEntity::TakeDamage((CBaseEntity *)this,(CTakeDamageInfo *)&local_7c);
    return;
  }
  cVar2 = (**(code **)(*(int *)this + 0x440))(this,2);
  if (cVar2 != '\0') {
    (**(code **)(**(int **)(this + 0x238) + 0xc4))(*(int **)(this + 0x238),&local_f4,0);
    local_e8 = *(float *)(param_2 + 0x20);
    local_e4 = *(float *)(param_2 + 0x24);
    local_e0 = *(float *)(param_2 + 0x28);
    VectorNormalize((Vector *)&local_e8);
    local_bc = local_e8 * 64.0;
    local_b8 = local_e4 * 64.0;
    local_b4 = local_e0 * 64.0;
    local_8c = 0;
    local_88 = 1;
    local_94 = 0;
    local_98 = 0;
    local_9c = 0;
    local_87 = local_b8 * local_b8 + local_bc * local_bc + local_b4 * local_b4 != 0.0;
    local_a4 = 0;
    local_a8 = 0;
    local_ac = 0;
    local_cc = local_f4;
    local_c8 = local_f0;
    local_c4 = local_ec;
    CTraceFilterSimple::CTraceFilterSimple
              ((CTraceFilterSimple *)&local_dc,(IHandleEntity *)this,0,
               (_func_bool_IHandleEntity_ptr_int *)0x0);
    (**(code **)(*enginetrace + 0x14))
              (enginetrace,&local_cc,0x46004003,(CTraceFilterSimple *)&local_dc,(Vector *)&local_7c)
    ;
    if (*(int *)(r_visualizetraces._28_4_ + 0x30) != 0) {
      DebugDrawLine((Vector *)&local_7c,(Vector *)&local_70,0xff,0,0,true,-1.0);
    }
    if (local_30 != 0) {
      if (*(int *)(this + 0x30) != 0) {
        iVar4 = *(int *)(this + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
        if (iVar4 % 3 == 1) {
          UTIL_DecalTrace((CGameTrace *)&local_7c,"PaintSplatGreen");
          goto LAB_007fa5cb;
        }
        if (iVar4 % 3 == 2) {
          UTIL_DecalTrace((CGameTrace *)&local_7c,"PaintSplatPink");
          goto LAB_007fa5cb;
        }
        if (iVar4 != (iVar4 / 3) * 3) goto LAB_007fa5cb;
      }
      UTIL_DecalTrace((CGameTrace *)&local_7c,"PaintSplatBlue");
    }
  }
LAB_007fa5cb:
  cVar2 = (**(code **)(*(int *)this + 0x440))(this,0xf);
  if (cVar2 == '\0') {
    return;
  }
  local_7c = 0;
  local_78 = 0;
  local_74 = 0;
  local_70 = 0;
  local_6c = 0;
                    /* try { // try from 007fa615 to 007fa66c has its CatchHandler @ 007fa946 */
  GetAllChildren((CBaseEntity *)this,(CUtlVector *)&local_7c);
  iVar4 = 0;
  if (0 < local_70) {
    do {
      iVar1 = *(int *)(local_7c + iVar4 * 4);
      if ((iVar1 != 0) &&
         (puVar3 = (undefined4 *)
                   __dynamic_cast(iVar1,&CBaseEntity::typeinfo,&IParentPropInteraction::typeinfo,
                                  0xfffffffe), puVar3 != (undefined4 *)0x0)) {
        (**(code **)*puVar3)(puVar3,1,param_1,param_2);
      }
      iVar4 = iVar4 + 1;
    } while (iVar4 < local_70);
  }
  local_70 = 0;
  CUtlMemory<CBaseEntity*,int>::Purge((CUtlMemory<CBaseEntity*,int> *)&local_7c);
  local_6c = local_7c;
  CUtlMemory<CBaseEntity*,int>::Purge((CUtlMemory<CBaseEntity*,int> *)&local_7c);
  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)