L L4D2node

Tank::OnTakeDamage_Alive

0x00ae08a0 · 592 bytes · __thiscall

_ZN4Tank18OnTakeDamage_AliveERK15CTakeDamageInfo

Decompiled

undefined (2 params)

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

undefined4 __thiscall Tank::OnTakeDamage_Alive(Tank *this,CTakeDamageInfo *param_1)

{
  uint uVar1;
  CBaseEntity *this_00;
  CBaseEdict *this_01;
  char cVar2;
  undefined4 uVar3;
  int iVar4;
  undefined4 uVar5;
  undefined *puVar6;
  int iVar7;
  longdouble lVar8;
  int local_20 [4];
  
  iVar4 = *(int *)(this + 0x100);
  if ((((byte)param_1[0x48] & 8) != 0) &&
     ((*(float *)(this + 0x42f8) <= 0.0 ||
      (lVar8 = (longdouble)IntervalTimer::Now(), 1.0 < (float)lVar8 - *(float *)(this + 0x42f8)))))
  {
    (**(code **)(*(int *)(this + 0x4028) + 0x40))(this + 0x4028);
    lVar8 = (longdouble)IntervalTimer::Now();
    if ((float)lVar8 != *(float *)(this + 0x42f8)) {
      (**(code **)(*(int *)(this + 0x42f4) + 4))(this + 0x42f4,this + 0x42f8);
      *(float *)(this + 0x42f8) = (float)lVar8;
    }
  }
  (**(code **)(*(int *)(this + 0x4028) + 0x44))(this + 0x4028,param_1);
  uVar3 = CTerrorPlayer::OnTakeDamage_Alive((CTerrorPlayer *)this,param_1);
  iVar7 = *(int *)(this + 0x100);
  uVar1 = *(uint *)(param_1 + 0x34);
  if (uVar1 == 0xffffffff) {
    return uVar3;
  }
  puVar6 = g_pEntityList + (uVar1 & 0xfff) * 0x10;
  if (puVar6 == (undefined *)0xfffffffc) {
    return uVar3;
  }
  if (*(uint *)(puVar6 + 8) != uVar1 >> 0xc) {
    return uVar3;
  }
  this_00 = *(CBaseEntity **)(puVar6 + 4);
  if (this_00 == (CBaseEntity *)0x0) {
    return uVar3;
  }
  cVar2 = (**(code **)(*(int *)this_00 + 0x16c))(this_00);
  if (cVar2 == '\0') {
    return uVar3;
  }
  cVar2 = (**(code **)(*(int *)this + 0x7e8))(this);
  if (cVar2 == '\0') {
    if (this_00 == (CBaseEntity *)this) {
      uVar5 = *(undefined4 *)(this + 0x30);
    }
    else {
      iVar4 = (iVar4 - iVar7) + *(int *)(this_00 + 0x3958);
      if (*(int *)(this_00 + 0x3958) == iVar4) goto LAB_00ae09f9;
      if (this_00[0x6c] == (CBaseEntity)0x0) {
        this_01 = *(CBaseEdict **)(this_00 + 0x30);
        uVar5 = 0;
        if (this_01 != (CBaseEdict *)0x0) {
          *(uint *)this_01 = *(uint *)this_01 | 0x101;
          iVar7 = CBaseEdict::GetChangeAccessor(this_01);
          *(undefined2 *)(iVar7 + 2) = 0;
          uVar5 = *(undefined4 *)(this_00 + 0x30);
        }
      }
      else {
        this_00[0x70] = (CBaseEntity)((byte)this_00[0x70] | 1);
        uVar5 = *(undefined4 *)(this_00 + 0x30);
      }
      *(int *)(this_00 + 0x3958) = iVar4;
    }
  }
  else {
LAB_00ae09f9:
    uVar5 = *(undefined4 *)(this_00 + 0x30);
  }
  iVar4 = (**(code **)(*engine + 0x40))(engine,uVar5);
  if (0 < *(int *)(this + 0x4330)) {
    if (iVar4 == **(int **)(this + 0x4324)) goto LAB_00ae0a6e;
    iVar7 = 0;
    do {
      iVar7 = iVar7 + 1;
      if (iVar7 == *(int *)(this + 0x4330)) goto LAB_00ae0a38;
    } while (iVar4 != (*(int **)(this + 0x4324))[iVar7]);
    if (-1 < iVar7) goto LAB_00ae0a6e;
  }
LAB_00ae0a38:
  local_20[0] = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(this_00 + 0x30));
  CUtlVector<int,CUtlMemory<int,int>>::InsertBefore
            ((CUtlVector<int,CUtlMemory<int,int>> *)(this + 0x4324),*(int *)(this + 0x4330),local_20
            );
LAB_00ae0a6e:
  iVar4 = CBaseEntity::GetTeamNumber(this_00);
  cVar2 = IsASurvivorTeam(iVar4);
  if (cVar2 == '\0') {
    return uVar3;
  }
  *(uint *)(this + 0x4338) = *(uint *)(this + 0x4338) | *(uint *)(param_1 + 0x48);
  return uVar3;
}

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)