L L4D2node

CRagdollProp::HandleFirstCollisionInteractions

0x00797690 · 1301 bytes · __thiscall

_ZN12CRagdollProp32HandleFirstCollisionInteractionsEiP21gamevcollisionevent_t

Decompiled

undefined (3 params)

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

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

{
  char cVar1;
  char cVar2;
  undefined4 *puVar3;
  int iVar4;
  undefined4 local_e8;
  undefined4 local_e4;
  undefined4 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;
  undefined4 local_7c;
  undefined4 local_78;
  undefined4 local_74;
  undefined4 local_70;
  undefined4 local_6c;
  undefined4 local_68;
  undefined4 local_4c;
  undefined4 local_48;
  float local_40;
  undefined4 local_34;
  
  if (*(int *)(this + 0x238) != 0) {
    cVar1 = HasPhysgunInteraction(this,"onfirstimpact","break");
    if (cVar1 != '\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;
    }
    cVar1 = HasPhysgunInteraction(this,"onfirstimpact","paintsplat");
    if (cVar1 != '\0') {
      (**(code **)(**(int **)(this + 0x238) + 0xc4))(*(int **)(this + 0x238),&local_e8,0);
      local_88 = 1;
      local_8c = 0;
      local_bc = *(float *)(param_2 + 0x20) * 1.5;
      local_b8 = *(float *)(param_2 + 0x24) * 1.5;
      local_b4 = *(float *)(param_2 + 0x28) * 1.5;
      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_e8;
      local_c8 = local_e4;
      local_c4 = local_e0;
      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);
      }
      iVar4 = (**(code **)(*random_valve + 8))(random_valve,1,3);
      if (iVar4 == 2) {
        UTIL_DecalTrace((CGameTrace *)&local_7c,"PaintSplatGreen");
      }
      else if (iVar4 == 3) {
        UTIL_DecalTrace((CGameTrace *)&local_7c,"PaintSplatPink");
      }
      else if (iVar4 == 1) {
        UTIL_DecalTrace((CGameTrace *)&local_7c,"PaintSplatBlue");
      }
    }
    cVar1 = HasPhysgunInteraction(this,"onfirstimpact","alienbloodsplat");
    if ((cVar1 != '\0') ||
       (cVar2 = HasPhysgunInteraction(this,"onfirstimpact","bloodsplat"), cVar2 != '\0')) {
      (**(code **)(**(int **)(this + 0x238) + 0xc4))(*(int **)(this + 0x238),&local_e8,0);
      local_88 = 1;
      local_8c = 0;
      local_bc = *(float *)(param_2 + 0x20) * 1.5;
      local_b8 = *(float *)(param_2 + 0x24) * 1.5;
      local_b4 = *(float *)(param_2 + 0x28) * 1.5;
      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_e8;
      local_c8 = local_e4;
      local_c4 = local_e0;
      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);
      }
      UTIL_BloodDecalTrace((CGameTrace *)&local_7c,~-(uint)(cVar1 == '\0') & 2);
    }
  }
  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)