L L4D2node

CTerrorPlayer::OnIncapacitatedAsTank

0x009a79d0 · 755 bytes · __thiscall

_ZN13CTerrorPlayer21OnIncapacitatedAsTankERK15CTakeDamageInfo

Decompiled

undefined (2 params)

/* CTerrorPlayer::OnIncapacitatedAsTank(CTakeDamageInfo const&) */

void __thiscall CTerrorPlayer::OnIncapacitatedAsTank(CTerrorPlayer *this,CTakeDamageInfo *param_1)

{
  CBaseEdict *this_00;
  int iVar1;
  char cVar2;
  uint uVar3;
  KeyValues *this_01;
  int iVar4;
  int *piVar5;
  undefined4 *puVar6;
  undefined *puVar7;
  longdouble lVar8;
  undefined4 local_20;
  
  uVar3 = CMultiPlayerAnimState::GetMainActivity(*(CMultiPlayerAnimState **)(this + 0x2910));
  cVar2 = IsMotionControlledZ(this);
  if (cVar2 != '\0') {
    if (*(int *)(this + 0x100) != 1) {
      (**(code **)(*(int *)this + 0x214))(this,this + 0x100);
      *(undefined4 *)(this + 0x100) = 1;
    }
    return;
  }
  this_01 = KeyValues::operator_new((KeyValues *)0x2c,uVar3);
                    /* try { // try from 009a7a59 to 009a7a5d has its CatchHandler @ 009a7ce4 */
  KeyValues::KeyValues(this_01,"deathEvent",(IKeyValuesSystem *)0x0,false);
  piVar5 = g_pGameRules;
  *(KeyValues **)(this + 0x2e20) = this_01;
  local_20 = 0;
  uVar3 = *(uint *)(param_1 + 0x34);
  if (((uVar3 != 0xffffffff) &&
      (puVar7 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
     (*(uint *)(puVar7 + 8) == uVar3 >> 0xc)) {
    local_20 = *(undefined4 *)(puVar7 + 4);
  }
  (**(code **)(*piVar5 + 0x2d4))(piVar5,this_01,local_20,this,param_1);
  if (*(int *)(mp_logdetail._28_4_ + 0x30) == 3) {
    LogDamage(this,param_1,1);
  }
  *(undefined4 *)(this + 0x39e8) = 0;
  *(undefined4 *)(this + 0x39ec) = 0;
  if (this[0x2d94] != (CTerrorPlayer)0x1) {
    if (this[0x6c] == (CTerrorPlayer)0x0) {
      this_00 = *(CBaseEdict **)(this + 0x30);
      if (this_00 != (CBaseEdict *)0x0) {
        *(uint *)this_00 = *(uint *)this_00 | 0x101;
        iVar4 = CBaseEdict::GetChangeAccessor(this_00);
        *(undefined2 *)(iVar4 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
    }
    this[0x2d94] = (CTerrorPlayer)0x1;
  }
  uVar3 = *(uint *)(param_1 + 0x34);
  if (((uVar3 == 0xffffffff) ||
      (puVar7 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar7 == (undefined *)0xfffffffc)) ||
     ((*(uint *)(puVar7 + 8) != uVar3 >> 0xc ||
      (piVar5 = *(int **)(puVar7 + 4), piVar5 == (int *)0x0)))) {
    *(undefined4 *)(this + 0x2da8) = 0xffffffff;
  }
  else {
    puVar6 = (undefined4 *)(**(code **)(*piVar5 + 0xc))(piVar5);
    *(undefined4 *)(this + 0x2da8) = *puVar6;
  }
  lVar8 = (longdouble)IntervalTimer::Now();
  if ((float)lVar8 != *(float *)(this + 0x2db0)) {
    (**(code **)(*(int *)(this + 0x2dac) + 4))(this + 0x2dac,this + 0x2db0);
    *(float *)(this + 0x2db0) = (float)lVar8;
  }
  MakeIncapacitatedEventFromInfo(this,param_1,false);
  iVar4 = *(int *)(this + 0x100);
  iVar1 = *(int *)(ZombieHulkIncapacitatedHealth._28_4_ + 0x30);
  lVar8 = (longdouble)(**(code **)(*(int *)this + 0x7e4))(this);
  iVar4 = (int)(((float)iVar1 - (float)*(int *)(this + 0x2984)) + (float)iVar4 + (float)lVar8);
  if (iVar4 != *(int *)(this + 0x100)) {
    (**(code **)(*(int *)this + 0x214))(this,this + 0x100);
    *(int *)(this + 0x100) = iVar4;
  }
  CBaseEntity::EmitSound((CBaseEntity *)this,"HulkZombie.Die",0.0,(float *)0x0);
  piVar5 = (int *)CCSPlayer::GetActiveCSWeapon((CCSPlayer *)this);
  if (piVar5 != (int *)0x0) {
    (**(code **)(*piVar5 + 0x430))(piVar5,0);
  }
  (**(code **)(*(int *)this + 0x7fc))(this,10,0);
  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)