L L4D2node

CBaseEntity::ImpactTrace

0x0040dd40 · 723 bytes · __thiscall

_ZN11CBaseEntity11ImpactTraceEP10CGameTraceiPc

Decompiled

undefined (4 params)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CBaseEntity::ImpactTrace(CGameTrace*, int, char*) */

void __thiscall
CBaseEntity::ImpactTrace(CBaseEntity *this,CGameTrace *param_1,int param_2,char *param_3)

{
  int iVar1;
  undefined4 uVar2;
  undefined4 uVar3;
  char cVar4;
  int iVar5;
  int iVar6;
  undefined4 local_84;
  undefined4 local_80;
  undefined4 local_7c;
  undefined4 local_78;
  undefined4 local_74;
  undefined4 local_70;
  undefined4 local_6c;
  undefined4 local_68;
  undefined4 local_64;
  undefined4 local_60;
  undefined4 local_5c;
  undefined4 local_58;
  undefined4 local_54;
  undefined4 local_50;
  undefined4 local_4c;
  int local_48;
  undefined4 local_44;
  undefined4 local_40;
  undefined4 local_3c;
  undefined4 local_38;
  short local_34;
  undefined4 local_30;
  int local_2c;
  undefined4 local_28;
  undefined1 local_24;
  undefined1 local_23;
  
  local_84 = 0;
  local_80 = 0;
  if (___atan2f_finite == 0) {
    iVar6 = 0;
  }
  else {
    (**(code **)(___atan2f_finite + 0x50))
              (___atan2f_finite,&local_84,0,0,0,0,
               "/data/src/game/server/../../game/shared/baseentity_shared.cpp",0x2ac,
               &ImpactTrace(CGameTrace*,int,char*)::tm_fmt,"(%s)%s","Unaccounted",
               "CBaseEntity::ImpactTrace");
    iVar6 = ___atan2f_finite;
  }
  uVar3 = local_80;
  uVar2 = local_84;
  iVar1 = _DAT_0105db00;
  if ((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) {
                    /* try { // try from 0040df96 to 0040dfe4 has its CatchHandler @ 0040e0c3 */
    iVar5 = ThreadGetCurrentId();
    if (iVar1 == iVar5) {
      if ((char *)*_DAT_0105d15c != "CBaseEntity::ImpactTrace") {
        _DAT_0105d15c =
             (int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xc09621,(char *)0x1,0xbfafa1);
      }
      CVProfNode::EnterScope();
      DAT_0105d158 = '\0';
    }
  }
  local_64 = 0;
  local_7c = *(undefined4 *)(param_1 + 0xc);
  local_60 = 0;
  local_5c = 0;
  local_78 = *(undefined4 *)(param_1 + 0x10);
  local_58 = 0;
  local_34 = 0;
  if (-1 < *(short *)(param_1 + 0x40)) {
    local_34 = *(short *)(param_1 + 0x40);
  }
  local_74 = *(undefined4 *)(param_1 + 0x14);
  local_54 = 0;
  local_70 = *(undefined4 *)param_1;
  local_50 = 0;
  local_6c = *(undefined4 *)(param_1 + 4);
  local_2c = param_2;
  local_28 = *(undefined4 *)(param_1 + 0x50);
  local_68 = *(undefined4 *)(param_1 + 8);
  local_4c = 0;
  local_44 = 0x3f800000;
  local_38 = 0;
  local_40 = 0;
  local_3c = 0;
  local_30 = 0;
  local_24 = 0;
  local_23 = 0;
  if (*(int *)(*(int *)(param_1 + 0x4c) + 0x30) == 0) {
    local_48 = 0;
  }
  else {
    local_48 = *(int *)(*(int *)(param_1 + 0x4c) + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
  }
  if (param_3 == (char *)0x0) {
                    /* try { // try from 0040e027 to 0040e02b has its CatchHandler @ 0040e031 */
    DispatchEffect("Impact",(CEffectData *)&local_7c);
  }
  else {
                    /* try { // try from 0040dee9 to 0040deed has its CatchHandler @ 0040e031 */
    DispatchEffect(param_3,(CEffectData *)&local_7c);
  }
  iVar1 = _DAT_0105db00;
  if ((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) {
    iVar5 = ThreadGetCurrentId();
    if (iVar1 == iVar5) {
      cVar4 = CVProfNode::ExitScope();
      if (cVar4 != '\0') {
        _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
      }
      DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
    }
  }
  if (iVar6 != 0) {
    (**(code **)(iVar6 + 0x54))(iVar6,uVar2,uVar3,0,0,0);
  }
  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)