L L4D2node

CGunTarget::OnTakeDamage

0x006d8310 · 214 bytes · __thiscall

_ZN10CGunTarget12OnTakeDamageERK15CTakeDamageInfo

Decompiled

undefined (2 params)

/* CGunTarget::OnTakeDamage(CTakeDamageInfo const&) */

undefined4 __thiscall CGunTarget::OnTakeDamage(CGunTarget *this,CTakeDamageInfo *param_1)

{
  int iVar1;
  uint uVar2;
  CBaseEntity *pCVar3;
  undefined *puVar4;
  int iVar5;
  
  iVar1 = *(int *)(this + 0x100);
  if (0 < iVar1) {
    iVar5 = iVar1 - (int)*(float *)(param_1 + 0x3c);
    if (iVar1 != iVar5) {
      (**(code **)(*(int *)this + 0x214))(this,this + 0x100);
      *(int *)(this + 0x100) = iVar5;
      if (iVar5 < 1) {
        if (iVar5 != 0) {
          (**(code **)(*(int *)this + 0x214))(this,this + 0x100);
          *(undefined4 *)(this + 0x100) = 0;
        }
        Stop(this);
        pCVar3 = (CBaseEntity *)0x0;
        uVar2 = *(uint *)(param_1 + 0x30);
        if (((uVar2 != 0xffffffff) &&
            (puVar4 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar4 != (undefined *)0xfffffffc)) &&
           (*(uint *)(puVar4 + 8) == uVar2 >> 0xc)) {
          pCVar3 = *(CBaseEntity **)(puVar4 + 4);
        }
        COutputEvent::FireOutput((COutputEvent *)(this + 0x4c0),pCVar3,(CBaseEntity *)this,0.0);
      }
    }
  }
  return 0;
}

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)