L L4D2node

CCSGameRules::GetExplosionDamageAdjustment

0x00436140 · 1162 bytes · __thiscall

_ZN12CCSGameRules28GetExplosionDamageAdjustmentER6VectorS1_P11CBaseEntity

Decompiled

undefined (4 params)

/* CCSGameRules::GetExplosionDamageAdjustment(Vector&, Vector&, CBaseEntity*) */

longdouble __thiscall
CCSGameRules::GetExplosionDamageAdjustment
          (CCSGameRules *this,Vector *param_1,Vector *param_2,CBaseEntity *param_3)

{
  uint uVar1;
  int *piVar2;
  char cVar3;
  undefined4 uVar4;
  undefined *puVar5;
  CBaseEntity *local_f4;
  float local_e4;
  undefined1 local_e0 [4];
  CTraceFilterSimple local_dc [16];
  float local_cc;
  float local_c8;
  float 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;
  Vector local_70 [12];
  Vector local_64 [32];
  float local_44;
  CBaseEntity *local_24;
  
  local_88 = 1;
  local_8c = 0;
  local_cc = *(float *)param_1;
  local_c8 = *(float *)(param_1 + 4);
  local_bc = *(float *)param_2 - local_cc;
  local_c4 = *(float *)(param_1 + 8);
  local_b8 = *(float *)(param_2 + 4) - local_c8;
  local_b4 = *(float *)(param_2 + 8) - local_c4;
  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;
  CTraceFilterSimple::CTraceFilterSimple
            (local_dc,(IHandleEntity *)param_3,0,(_func_bool_IHandleEntity_ptr_int *)0x0);
  (**(code **)(*enginetrace + 0x14))(enginetrace,&local_cc,0x46004003,local_dc,local_70);
  if (*(int *)(r_visualizetraces._28_4_ + 0x30) != 0) {
    DebugDrawLine(local_70,local_64,0xff,0,0,true,-1.0);
  }
  if (local_44 != 1.0) {
    cVar3 = CGameTrace::DidHitWorld((CGameTrace *)local_70);
    if (cVar3 == '\0') {
      if ((local_24 != (CBaseEntity *)0x0) && (param_3 != local_24)) {
        local_f4 = (CBaseEntity *)0x0;
        uVar1 = *(uint *)(local_24 + 0x220);
        if ((uVar1 != 0xffffffff) &&
           ((puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc &&
            (*(uint *)(puVar5 + 8) == uVar1 >> 0xc)))) {
          local_f4 = *(CBaseEntity **)(puVar5 + 4);
        }
        if (param_3 != local_f4) {
          cVar3 = (**(code **)(*(int *)this + 0x294))(this,local_24);
          if (cVar3 == '\0') {
            local_cc = *(float *)param_1;
            local_88 = 1;
            local_94 = 0;
            local_c4 = *(float *)(param_1 + 8);
            local_c8 = *(float *)(param_1 + 4);
            local_bc = *(float *)param_2 - local_cc;
            local_b4 = *(float *)(param_2 + 8) - local_c4;
            local_b8 = *(float *)(param_2 + 4) - local_c8;
            local_98 = 0;
            local_9c = 0;
            local_8c = 0;
            local_a4 = 0;
            local_a8 = 0;
            local_ac = 0;
            local_87 = local_b4 * local_b4 + local_bc * local_bc + local_b8 * local_b8 != 0.0;
            CTraceFilterSimple::CTraceFilterSimple
                      (local_dc,(IHandleEntity *)0x0,0,(_func_bool_IHandleEntity_ptr_int *)0x0);
            (**(code **)(*enginetrace + 0x14))(enginetrace,&local_cc,1,local_dc,local_70);
            if (*(int *)(r_visualizetraces._28_4_ + 0x30) != 0) {
              DebugDrawLine(local_70,local_64,0xff,0,0,true,-1.0);
            }
            if (local_44 == 1.0) {
              local_44 = 0.75;
              piVar2 = *(int **)(local_24 + 0x238);
              if (piVar2 != (int *)0x0) {
                uVar4 = (**(code **)(*piVar2 + 0x9c))(piVar2);
                (**(code **)(*physprops + 0x14))
                          (physprops,uVar4,&local_e4,local_e0,local_dc,&local_cc);
                local_e4 = local_e4 * 0.00033333333;
                if ((1.0 <= local_e4) || (local_e4 < 0.0)) {
                  local_44 = (float)(-(uint)(local_e4 < 0.0) & 0x3f800000);
                }
                else {
                  local_44 = 1.0 - local_e4;
                }
              }
              goto LAB_004362c4;
            }
          }
        }
      }
    }
    local_44 = 0.0;
  }
LAB_004362c4:
  return (longdouble)local_44;
}

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)