L L4D2node

CTerrorPlayer::AbortZombie

0x009b8970 · 930 bytes · __thiscall

_ZN13CTerrorPlayer11AbortZombieEv

Decompiled

undefined (1 param)

/* CTerrorPlayer::AbortZombie() */

void __thiscall CTerrorPlayer::AbortZombie(CTerrorPlayer *this)

{
  int iVar1;
  char cVar2;
  uint uVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  undefined4 uVar7;
  undefined4 uVar8;
  undefined4 uVar9;
  CCSPlayer *this_00;
  CCSPlayer *local_44;
  undefined4 local_40;
  undefined4 local_3c;
  undefined4 local_38;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  
  uVar3 = *(uint *)(this + 0x14c);
  if ((uVar3 & 0x800) == 0) {
    local_40 = *(undefined4 *)(this + 0x2e0);
    local_3c = *(undefined4 *)(this + 0x2e4);
    local_38 = *(undefined4 *)(this + 0x2e8);
  }
  else {
    CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
    local_40 = *(undefined4 *)(this + 0x2e0);
    uVar3 = *(uint *)(this + 0x14c);
    local_3c = *(undefined4 *)(this + 0x2e4);
    local_38 = *(undefined4 *)(this + 0x2e8);
    if ((uVar3 & 0x800) != 0) {
      CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
      uVar3 = *(uint *)(this + 0x14c);
    }
  }
  local_34 = *(undefined4 *)(this + 0x37c);
  local_30 = *(undefined4 *)(this + 0x380);
  local_2c = *(undefined4 *)(this + 900);
  if ((uVar3 & 0x1000) != 0) {
    CBaseEntity::CalcAbsoluteVelocity((CBaseEntity *)this);
  }
  local_28 = *(undefined4 *)(this + 0x274);
  local_24 = *(undefined4 *)(this + 0x278);
  local_20 = *(undefined4 *)(this + 0x27c);
  iVar4 = (**(code **)(*(int *)this + 0x544))(this);
  iVar1 = *(int *)(this + 0x100);
  uVar3 = *(uint *)(this + 0x150);
  cVar2 = (**(code **)(*(int *)this + 0x558))(this);
  if (*(int *)(ZombieDebug._28_4_ + 0x30) != 0) {
    uVar7 = ZombieClassName(iVar4);
    uVar8 = (**(code **)(*(int *)this + 0xb8))(this);
    Msg("ABORTING: %s as %s\n",uVar8,uVar7);
  }
  CullZombie(this);
  if (cVar2 != '\0') {
    return;
  }
  local_44 = (CCSPlayer *)0x0;
  ForEachTerrorPlayer<ReplacementPZScan>((ReplacementPZScan *)&local_44);
  this_00 = local_44;
  if (local_44 == (CCSPlayer *)0x0) {
    if (iVar4 == 2) {
      this_00 = (CCSPlayer *)NextBotCreatePlayerBot<Boomer>("Boomer");
    }
    else if (iVar4 < 3) {
      if (iVar4 != 1) {
        return;
      }
      this_00 = (CCSPlayer *)NextBotCreatePlayerBot<Smoker>("Smoker");
    }
    else if (iVar4 == 3) {
      this_00 = (CCSPlayer *)NextBotCreatePlayerBot<Hunter>("Hunter");
    }
    else {
      if (iVar4 != 8) {
        return;
      }
      this_00 = (CCSPlayer *)NextBotCreatePlayerBot<Tank>("Tank");
    }
    if (this_00 == (CCSPlayer *)0x0) {
      return;
    }
    (**(code **)(*(int *)this_00 + 0x8cc))(this_00,3,8,0);
  }
  g_IsZombieSpawnMobRush = 1;
  g_ZombieClass = iVar4;
  CCSPlayer::State_Transition(this_00,0);
  (**(code **)(*(int *)this_00 + 100))(this_00);
  this_00[0x1a90] = *(CCSPlayer *)(this + 0x1a90);
  this_00[0x1a91] = *(CCSPlayer *)(this + 0x1a91);
  if (((byte)this[0x150] & 2) == 0) {
    iVar5 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
    iVar6 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
    CBaseEntity::SetCollisionBounds
              ((CBaseEntity *)this_00,(Vector *)(iVar6 + 0xc),(Vector *)(iVar5 + 0x18));
  }
  else {
    CBaseEntity::AddFlag((CBaseEntity *)this_00,2);
    iVar5 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
    iVar6 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
    CBaseEntity::SetCollisionBounds
              ((CBaseEntity *)this_00,(Vector *)(iVar6 + 0x24),(Vector *)(iVar5 + 0x30));
  }
  if ((uVar3 & 0x8000000) != 0) {
    (**(code **)(*(int *)this_00 + 0x380))(this_00,0x461c3c00,0,0,0);
  }
  if (iVar1 != *(int *)(this_00 + 0x100)) {
    (**(code **)(*(int *)this_00 + 0x214))(this_00,this_00 + 0x100);
    *(int *)(this_00 + 0x100) = iVar1;
  }
  CBaseEntity::SetAbsOrigin((CBaseEntity *)this_00,(Vector *)&local_40);
  CBaseEntity::SetAbsAngles((CBaseEntity *)this_00,(QAngle *)&local_34);
  CBaseEntity::SetAbsVelocity((CBaseEntity *)this_00,(Vector *)&local_28);
  if (*(int *)(ZombieDebug._28_4_ + 0x30) != 0) {
    uVar7 = ZombieClassName(iVar4);
    uVar8 = (**(code **)(*(int *)this_00 + 0xb8))(this_00);
    uVar9 = (**(code **)(*(int *)this + 0xb8))(this);
    DevMsg("%s: REPLACED by %s as %s!\n",uVar9,uVar8,uVar7);
  }
  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)