L L4D2node

CPhysImpact::InputImpact

0x0079d7c0 · 1423 bytes · __cdecl

_ZN11CPhysImpact11InputImpactER11inputdata_t

Decompiled

undefined (1 param)

/* CPhysImpact::InputImpact(inputdata_t&) */

void CPhysImpact::InputImpact(inputdata_t *param_1)

{
  int *piVar1;
  undefined4 *puVar2;
  longdouble lVar3;
  float fVar4;
  Vector *pVVar5;
  CGameTrace *pCVar6;
  Vector *pVVar7;
  float local_f8;
  float local_f4;
  float local_f0;
  undefined4 local_ec;
  undefined4 local_e8;
  undefined4 local_e4;
  float local_e0;
  float local_dc;
  float local_d8;
  Vector local_d0 [12];
  float local_c4;
  float local_c0;
  float local_bc;
  float local_b8;
  float local_b4;
  float local_b0;
  float local_a4;
  char local_99;
  CTakeDamageInfo *local_84;
  undefined4 local_7c;
  undefined4 local_78;
  undefined4 local_74;
  float local_6c;
  float local_68;
  float local_64;
  undefined4 local_5c;
  undefined4 local_58;
  undefined4 local_54;
  undefined4 local_4c;
  undefined4 local_48;
  undefined4 local_44;
  undefined4 local_40;
  undefined4 local_3c;
  undefined1 local_38;
  undefined1 local_37;
  undefined4 local_34;
  
  if (*(int *)(param_1 + 0x448) != 0) {
    UTIL_PointAtNamedEntity(param_1,*(undefined4 *)(param_1 + 0x448));
  }
  if (((byte)param_1[0x14d] & 8) != 0) {
    CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
  }
  AngleVectors((QAngle *)(param_1 + 0x37c),(Vector *)&local_f8);
  local_64 = 56755.84;
  if (((byte)param_1[0x148] & 2) == 0) {
    local_64 = *(float *)(param_1 + 0x444);
  }
  if (((byte)param_1[0x14d] & 8) != 0) {
    CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
  }
  local_ec = *(undefined4 *)(param_1 + 0x2e0);
  local_38 = 1;
  local_3c = 0;
  pVVar7 = local_d0;
  local_6c = local_f8 * local_64;
  local_68 = local_f4 * local_64;
  local_e8 = *(undefined4 *)(param_1 + 0x2e4);
  local_64 = local_64 * local_f0;
  local_e4 = *(undefined4 *)(param_1 + 0x2e8);
  local_44 = 0;
  local_48 = 0;
  local_4c = 0;
  local_37 = local_68 * local_68 + local_6c * local_6c + local_64 * local_64 != 0.0;
  local_54 = 0;
  local_58 = 0;
  local_5c = 0;
  local_7c = local_ec;
  local_78 = local_e8;
  local_74 = local_e4;
  CTraceFilterSimple::CTraceFilterSimple
            ((CTraceFilterSimple *)&local_e0,(IHandleEntity *)param_1,0,
             (_func_bool_IHandleEntity_ptr_int *)0x0);
  (**(code **)(*enginetrace + 0x14))
            (enginetrace,&local_7c,0x46004003,(CTraceFilterSimple *)&local_e0,pVVar7);
  if (*(int *)(r_visualizetraces._28_4_ + 0x30) != 0) {
    DebugDrawLine(pVVar7,(Vector *)&local_c4,0xff,0,0,true,-1.0);
  }
  if (*(int *)(debug_physimpact._28_4_ + 0x30) != 0) {
    NDebugOverlay::Cross3D((Vector *)&local_ec,24.0,0xff,0xff,0xff,false,30.0);
    NDebugOverlay::Line(pVVar7,(Vector *)&local_c4,0,0xff,0,false,30.0);
  }
  if (local_a4 != 1.0) {
    if (local_99 != '\0') {
      local_b0 = -local_f0;
      local_b4 = -local_f4;
      local_b8 = -local_f8;
    }
    piVar1 = *(int **)(local_84 + 0x238);
    if (piVar1 != (int *)0x0) {
      CTakeDamageInfo::CTakeDamageInfo((CTakeDamageInfo *)&local_7c);
      puVar2 = (undefined4 *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
      local_48 = *puVar2;
      puVar2 = (undefined4 *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
      local_4c = *puVar2;
      local_7c = vec3_origin;
      local_40 = 0;
      local_34 = 0;
      pCVar6 = (CGameTrace *)&local_f8;
      local_78 = DAT_01053d4c;
      pVVar5 = (Vector *)&local_7c;
      local_74 = DAT_01053d50;
      CBaseEntity::DispatchTraceAttack(local_84,pVVar5,pCVar6);
      ApplyMultiDamage();
      if ((*(uint *)(param_1 + 0x148) & 3) == 0) {
        fVar4 = (1.0 - local_a4) * *(float *)(param_1 + 0x440);
      }
      else {
        fVar4 = *(float *)(param_1 + 0x440);
      }
      if ((*(uint *)(param_1 + 0x148) & 4) != 0) {
        lVar3 = (longdouble)(**(code **)(*piVar1 + 0x78))(piVar1,pVVar5,pCVar6,pVVar7);
        fVar4 = fVar4 * (float)lVar3;
      }
      if (*(int *)(debug_physimpact._28_4_ + 0x30) != 0) {
        local_dc = local_b4 * -128.0 + local_c0;
        local_d8 = local_b0 * -128.0 + local_bc;
        local_e0 = local_b8 * -128.0 + local_c4;
        NDebugOverlay::Line((Vector *)&local_c4,(Vector *)&local_e0,0xff,0,0,false,30.0);
      }
      if (((byte)param_1[0x148] & 8) == 0) {
        local_f0 = -local_b0;
        local_f4 = -local_b4;
        local_f8 = -local_b8;
      }
      fVar4 = fVar4 * *(float *)(phys_pushscale._28_4_ + 0x2c);
      local_e0 = local_f8 * fVar4;
      local_dc = local_f4 * fVar4;
      local_d8 = fVar4 * local_f0;
      (**(code **)(*piVar1 + 0xf8))(piVar1,(CTraceFilterSimple *)&local_e0,(Vector *)&local_c4);
      return;
    }
  }
  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)