L L4D2node

CDirector::OnZombieRemoved

0x00881180 · 487 bytes · __thiscall

_ZN9CDirector15OnZombieRemovedEP13CTerrorPlayer

Decompiled

undefined (2 params)

/* CDirector::OnZombieRemoved(CTerrorPlayer*) */

void __thiscall CDirector::OnZombieRemoved(CDirector *this,CTerrorPlayer *param_1)

{
  int *piVar1;
  float fVar2;
  int iVar3;
  longdouble lVar4;
  CTerrorPlayer *local_20 [4];
  
  if ((param_1 != (CTerrorPlayer *)0x0) &&
     (iVar3 = CBaseEntity::GetTeamNumber((CBaseEntity *)param_1), iVar3 == 3)) {
    iVar3 = CBaseEntity::GetTeamNumber((CBaseEntity *)param_1);
    if ((iVar3 == 3) &&
       ((iVar3 = (**(code **)(*(int *)param_1 + 0x544))(param_1), iVar3 == 8 &&
        (*(int *)(this + 0x1c0) != 0)))) {
      iVar3 = *(int *)(this + 0x1c0) + -1;
      *(int *)(this + 0x1c0) = iVar3;
      DevMsg("Tank Count = %d\n",iVar3);
      local_20[0] = param_1;
      ForEachTerrorPlayer<ZombieDeathNotification>((ZombieDeathNotification *)local_20);
      if (*(int *)(this + 0x1c0) == 0) {
        QueueEntitiesToFadeOut(this);
      }
    }
    if ((CTerrorPlayer::gm_bBeingCulled == '\0') &&
       ((iVar3 = (**(code **)(*(int *)param_1 + 0x544))(param_1), -1 < iVar3 ||
        (iVar3 = (**(code **)(*(int *)param_1 + 0x544))(param_1), iVar3 < 9)))) {
      iVar3 = (**(code **)(*(int *)param_1 + 0x544))(param_1);
      iVar3 = iVar3 * 8;
      lVar4 = (longdouble)IntervalTimer::Now();
      if ((float)lVar4 != *(float *)(this + iVar3 + 0x2b0)) {
        (**(code **)(*(int *)(this + iVar3 + 0x2ac) + 4))(this + iVar3 + 0x2ac,this + iVar3 + 0x2b0)
        ;
        *(float *)(this + iVar3 + 0x2b0) = (float)lVar4;
      }
    }
    if (-1 < *(int *)(param_1 + 0x3ffc)) {
      if (*(int *)(param_1 + 0x3ffc) < *(int *)(this + 0x370)) {
        lVar4 = (longdouble)GetSpecialSlotCountdownTime(this);
        fVar2 = (float)lVar4;
        piVar1 = (int *)(*(int *)(this + 0x33c) + *(int *)(param_1 + 0x3ffc) * 0xc);
        lVar4 = (longdouble)CountdownTimer::Now();
        if ((float)lVar4 + fVar2 != (float)piVar1[2]) {
          (**(code **)(*piVar1 + 4))(piVar1,piVar1 + 2);
          piVar1[2] = (int)((float)lVar4 + fVar2);
        }
        if (fVar2 != (float)piVar1[1]) {
          (**(code **)(*piVar1 + 4))(piVar1,piVar1 + 1);
          piVar1[1] = (int)fVar2;
        }
      }
      *(undefined4 *)(param_1 + 0x3ffc) = 0xffffffff;
      return;
    }
  }
  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)