L L4D2node

TankAttack::OnInjured

0x00ae1160 · 386 bytes · __cdecl

_ZN10TankAttack9OnInjuredEP4TankRK15CTakeDamageInfo

Decompiled

undefined (2 params)

/* TankAttack::OnInjured(Tank*, CTakeDamageInfo const&) */

Tank * TankAttack::OnInjured(Tank *param_1,CTakeDamageInfo *param_2)

{
  uint uVar1;
  int *piVar2;
  code *pcVar3;
  char cVar4;
  int *piVar5;
  undefined4 uVar6;
  int iVar7;
  undefined *puVar8;
  int in_stack_0000000c;
  int in_stack_00000010;
  
  if ((*(byte *)(in_stack_00000010 + 0x48) & 8) != 0) {
    uVar1 = *(uint *)(in_stack_00000010 + 0x34);
    if ((((uVar1 != 0xffffffff) &&
         (puVar8 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
        (*(uint *)(puVar8 + 8) == uVar1 >> 0xc)) &&
       (piVar2 = *(int **)(puVar8 + 4), piVar2 != (int *)0x0)) {
      cVar4 = (**(code **)(*piVar2 + 0x16c))(piVar2);
      if (cVar4 != '\0') {
        if (*(float *)(param_2 + 0x486c) != -1.0) {
          (**(code **)(*(int *)(param_2 + 0x4868) + 4))(param_2 + 0x4868,param_2 + 0x486c);
          *(undefined4 *)(param_2 + 0x486c) = 0xbf800000;
        }
        piVar5 = (int *)(**(code **)(*gameeventmanager + 0x1c))
                                  (gameeventmanager,"zombie_ignited",0,0);
        if (piVar5 != (int *)0x0) {
          pcVar3 = *(code **)(*piVar5 + 0x30);
          uVar6 = (**(code **)(*engine + 0x40))(engine,piVar2[0xc]);
          (*pcVar3)(piVar5,"userid",uVar6);
          if (*(int *)(in_stack_0000000c + 0x30) == 0) {
            iVar7 = 0;
          }
          else {
            iVar7 = *(int *)(in_stack_0000000c + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
          }
          (**(code **)(*piVar5 + 0x30))(piVar5,"entityid",iVar7);
          (**(code **)(*piVar5 + 0x3c))(piVar5,"victimname","Tank");
          (**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar5,0);
        }
      }
    }
  }
  *(undefined4 *)param_1 = 4;
  *(undefined4 *)(param_1 + 4) = 0;
  *(undefined4 *)(param_1 + 8) = 0;
  *(undefined4 *)(param_1 + 0xc) = 1;
  return param_1;
}

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)