L L4D2node

CTerrorPlayer::OnZombieDied

0x009b44c0 · 526 bytes · __thiscall

_ZN13CTerrorPlayer12OnZombieDiedEPS_

Decompiled

undefined (2 params)

/* CTerrorPlayer::OnZombieDied(CTerrorPlayer*) */

void __thiscall CTerrorPlayer::OnZombieDied(CTerrorPlayer *this,CTerrorPlayer *param_1)

{
  CBaseEdict *this_00;
  char cVar1;
  int iVar2;
  undefined4 uVar3;
  int *piVar4;
  longdouble lVar5;
  float fVar6;
  float local_14;
  
  if ((((param_1 != (CTerrorPlayer *)0x0) &&
       (iVar2 = CBaseEntity::GetTeamNumber((CBaseEntity *)param_1), iVar2 == 3)) &&
      (iVar2 = (**(code **)(*(int *)param_1 + 0x544))(param_1), iVar2 == 8)) &&
     ((cVar1 = (**(code **)(*(int *)this + 300))(this), cVar1 == '\0' ||
      (cVar1 = (**(code **)(*(int *)this + 0x558))(this), cVar1 != '\0')))) {
    if (*(int *)(this + 0x2c14) == 1) {
      piVar4 = (int *)CDirectorTacticalServices::GetHighestFlowSurvivor
                                (*(CDirectorTacticalServices **)(TheDirector + 0x628),0);
      if (piVar4 != (int *)0x0) {
        iVar2 = (**(code **)(*piVar4 + 0x52c))(piVar4);
        if (iVar2 == 0) {
          local_14 = -9999.0;
        }
        else {
          local_14 = *(float *)(iVar2 + 0x154);
        }
        lVar5 = (longdouble)GetLineOfScrimmageDistance();
        if (*(float *)(this + 0x2bc0) <= (float)lVar5 + local_14) {
          piVar4 = (int *)CDirectorTacticalServices::GetHighestFlowSurvivor
                                    (*(CDirectorTacticalServices **)(TheDirector + 0x628),0);
          if (piVar4 == (int *)0x0) {
            return;
          }
          iVar2 = (**(code **)(*piVar4 + 0x52c))(piVar4);
          if (iVar2 == 0) {
            fVar6 = -9999.0;
          }
          else {
            fVar6 = *(float *)(iVar2 + 0x154);
          }
          lVar5 = (longdouble)GetLineOfScrimmageDistance();
          if (fVar6 - (float)lVar5 < *(float *)(this + 0x2be0) ||
              fVar6 - (float)lVar5 == *(float *)(this + 0x2be0)) {
            return;
          }
        }
        uVar3 = (**(code **)(*(int *)this + 0xb8))(this);
        UTIL_LogPrintf("%s is updating line of scrimmage at tank battle end\n",uVar3);
        UpdateLineOfScrimmage(this,-1.0,-1.0);
      }
    }
    else if (*(int *)(this + 0x2c14) == 2) {
      uVar3 = (**(code **)(*(int *)this + 0xb8))(this);
      UTIL_LogPrintf("%s is updating line of scrimmage at tank battle end\n",uVar3);
      ResizeScrimmageSphere(this);
      fVar6 = *(float *)(gpGlobals + 0xc) - *(float *)(ZombieScrimmageCreepDelay._28_4_ + 0x2c);
      if (fVar6 != *(float *)(this + 0x2c18)) {
        if (this[0x6c] == (CTerrorPlayer)0x0) {
          this_00 = *(CBaseEdict **)(this + 0x30);
          if (this_00 != (CBaseEdict *)0x0) {
            *(uint *)this_00 = *(uint *)this_00 | 0x101;
            iVar2 = CBaseEdict::GetChangeAccessor(this_00);
            *(undefined2 *)(iVar2 + 2) = 0;
          }
        }
        else {
          this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
        }
        *(float *)(this + 0x2c18) = fVar6;
      }
    }
  }
  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)