L L4D2node

CBasePlayer::OnDamagedByExplosion

0x007a9d90 · 424 bytes · __thiscall

_ZN11CBasePlayer20OnDamagedByExplosionERK15CTakeDamageInfo

Decompiled

undefined (2 params)

/* CBasePlayer::OnDamagedByExplosion(CTakeDamageInfo const&) */

void __thiscall CBasePlayer::OnDamagedByExplosion(CBasePlayer *this,CTakeDamageInfo *param_1)

{
  float fVar1;
  CBasePlayer CVar2;
  uint uVar3;
  CBaseEntity *this_00;
  bool bVar4;
  undefined4 uVar5;
  undefined *puVar6;
  undefined **local_3c [11];
  
  bVar4 = true;
  fVar1 = *(float *)(param_1 + 0x3c);
  uVar3 = *(uint *)(param_1 + 0x30);
  if ((((uVar3 != 0xffffffff) &&
       (puVar6 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc)) &&
      (*(uint *)(puVar6 + 8) == uVar3 >> 0xc)) &&
     (this_00 = *(CBaseEntity **)(puVar6 + 4), this_00 != (CBaseEntity *)0x0)) {
    if (((byte)this_00[0x14d] & 8) == 0) {
      CVar2 = this[0x14d];
    }
    else {
      CBaseEntity::CalcAbsolutePosition(this_00);
      CVar2 = this[0x14d];
    }
    if (((byte)CVar2 & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
    }
    bVar4 = 240.0 <= SQRT((*(float *)(this + 0x2e4) - *(float *)(this_00 + 0x2e4)) *
                          (*(float *)(this + 0x2e4) - *(float *)(this_00 + 0x2e4)) +
                          (*(float *)(this + 0x2e0) - *(float *)(this_00 + 0x2e0)) *
                          (*(float *)(this + 0x2e0) - *(float *)(this_00 + 0x2e0)) +
                          (*(float *)(this + 0x2e8) - *(float *)(this_00 + 0x2e8)) *
                          (*(float *)(this + 0x2e8) - *(float *)(this_00 + 0x2e8)));
  }
  if ((bVar4) && (30.0 > fVar1)) {
    return;
  }
  if (30.0 <= fVar1) {
    uVar5 = (**(code **)(*random_valve + 8))(random_valve,0x23,0x25);
  }
  else {
    uVar5 = (**(code **)(*random_valve + 8))(random_valve,0x20,0x22);
  }
  CRecipientFilter::CRecipientFilter((CRecipientFilter *)local_3c);
  local_3c[0] = &PTR__CSingleUserRecipientFilter_00c08ea8;
                    /* try { // try from 007a9e34 to 007a9e38 has its CatchHandler @ 007a9f67 */
  CRecipientFilter::AddRecipient((CRecipientFilter *)local_3c,this);
                    /* try { // try from 007a9e53 to 007a9e55 has its CatchHandler @ 007a9f4e */
  (**(code **)(*enginesound + 0x2c))(enginesound,(CRecipientFilter *)local_3c,uVar5,0);
  local_3c[0] = &PTR__CSingleUserRecipientFilter_00c08ea8;
  CRecipientFilter::~CRecipientFilter((CRecipientFilter *)local_3c);
  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)