L L4D2node

Tank::Event_Killed

0x00ae0610 · 633 bytes · __thiscall

_ZN4Tank12Event_KilledERK15CTakeDamageInfo

Decompiled

undefined (2 params)

/* Tank::Event_Killed(CTakeDamageInfo const&) */

void __thiscall Tank::Event_Killed(Tank *this,CTakeDamageInfo *param_1)

{
  char cVar1;
  int *piVar2;
  undefined4 uVar3;
  CBaseEntity *this_00;
  int iVar4;
  uint uVar5;
  undefined *puVar6;
  code *pcVar7;
  int iVar8;
  bool bVar9;
  int *local_28;
  
  *(undefined4 *)(TheDirector + 0x398) = 0;
  if ((this[0x433c] == (Tank)0x0) &&
     (piVar2 = (int *)(**(code **)(*gameeventmanager + 0x1c))(gameeventmanager,"tank_killed",0,0),
     piVar2 != (int *)0x0)) {
    uVar5 = *(uint *)(param_1 + 0x34);
    if (((uVar5 == 0xffffffff) ||
        (((puVar6 = g_pEntityList + (uVar5 & 0xfff) * 0x10, puVar6 == (undefined *)0xfffffffc ||
          (*(uint *)(puVar6 + 8) != uVar5 >> 0xc)) ||
         (local_28 = *(int **)(puVar6 + 4), local_28 == (int *)0x0)))) ||
       (cVar1 = (**(code **)(*local_28 + 0x16c))(local_28), cVar1 == '\0')) {
      pcVar7 = *(code **)(*piVar2 + 0x30);
      uVar3 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(this + 0x30));
      (*pcVar7)(piVar2,"userid",uVar3);
      local_28 = (int *)0x0;
      pcVar7 = *(code **)(*piVar2 + 0x30);
      uVar3 = 0;
    }
    else {
      pcVar7 = *(code **)(*piVar2 + 0x30);
      uVar3 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(this + 0x30));
      (*pcVar7)(piVar2,"userid",uVar3);
      pcVar7 = *(code **)(*piVar2 + 0x30);
      uVar3 = (**(code **)(*engine + 0x40))(engine,local_28[0xc]);
    }
    (*pcVar7)(piVar2,"attacker",uVar3);
    (**(code **)(*piVar2 + 0x2c))(piVar2,"solo",*(int *)(this + 0x4330) == 1);
    if (*(int *)(this + 0x4330) < 1) {
LAB_00ae0890:
      uVar3 = 0;
    }
    else {
      uVar3 = 0;
      iVar8 = 0;
      do {
        this_00 = (CBaseEntity *)UTIL_PlayerByUserId(*(int *)(*(int *)(this + 0x4324) + iVar8 * 4));
        if (this_00 != (CBaseEntity *)0x0) {
          iVar4 = CBaseEntity::GetTeamNumber(this_00);
          if (iVar4 == 2) goto LAB_00ae0890;
          if (iVar4 == 4) {
            uVar3 = 1;
          }
        }
        iVar8 = iVar8 + 1;
      } while (iVar8 < *(int *)(this + 0x4330));
    }
    (**(code **)(*piVar2 + 0x2c))(piVar2,"l4d1_only",uVar3);
    bVar9 = false;
    if (*(uint *)(this + 0x4338) != 0) {
      uVar5 = *(uint *)(this + 0x4338) & 0x3bd9ff7b;
      *(uint *)(this + 0x4338) = uVar5;
      if (local_28 != (int *)0x0) {
        bVar9 = uVar5 == 0;
      }
    }
    (**(code **)(*piVar2 + 0x2c))(piVar2,"melee_only",bVar9);
    (**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar2,0);
    this[0x433c] = (Tank)0x1;
    *(undefined4 *)(this + 0x4338) = 0;
  }
  (**(code **)(*(int *)(this + 0x4028) + 0x48))(this + 0x4028,param_1);
  CTerrorPlayer::Event_Killed((CTerrorPlayer *)this,param_1);
  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)