L L4D2node

Infected::Spawn

0x00a154e0 · 3126 bytes · __thiscall

_ZN8Infected5SpawnEv

Decompiled

undefined (1 param)

/* Infected::Spawn() */

void __thiscall Infected::Spawn(Infected *this)

{
  Infected *pIVar1;
  Infected *pIVar2;
  Infected *pIVar3;
  float fVar4;
  code *pcVar5;
  uint *puVar6;
  int *piVar7;
  char cVar8;
  Vector *pVVar9;
  int iVar10;
  int iVar11;
  uint uVar12;
  CUtlVector *pCVar13;
  undefined4 uVar14;
  int *piVar15;
  char *pcVar16;
  int *piVar17;
  longdouble lVar18;
  longdouble lVar19;
  undefined4 local_70;
  int local_44;
  undefined1 *local_40;
  char *local_34;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  
  pcVar16 = "FCVAR_NEVER_AS_STRING";
  piVar15 = (int *)&stack0xffffff94;
  local_70 = 0xa154fc;
  (**(code **)(*(int *)this + 0x5c8))();
  if (((ZombiePopulation[0x15] & 0x10) == 0) &&
     (pcVar16 = *(char **)(ZombiePopulation._28_4_ + 0x24), pcVar16 == (char *)0x0)) {
    pcVar16 = "";
  }
  local_70 = 0xa1552c;
  pVVar9 = (Vector *)(**(code **)(*(int *)(this + 0x1a3c) + 0xd4))();
  local_70 = 0xa15545;
  iVar10 = CNavMesh::GetNavArea(TheNavMesh,pVVar9,120.0);
  if ((iVar10 != 0) && (*(uint *)(iVar10 + 0x94) != 0)) {
    local_70 = 0xa15c91;
    pcVar16 = (char *)CNavMesh::PlaceToName(TheNavMesh,*(uint *)(iVar10 + 0x94));
  }
  local_70 = 0xa1555f;
  iVar10 = (**(code **)(*(int *)this + 0x1c))();
  if (iVar10 < 1) {
    pCVar13 = (CUtlVector *)&LowViolenceInfectedModels;
    if (*(char *)(*(int *)(TheDirector + 0x634) + 0x37) == '\0') {
      pCVar13 = (CUtlVector *)&CommonInfectedModels;
    }
    local_70 = 0xa15c38;
    local_40 = (undefined1 *)SelectModelByPopulation(pcVar16,pCVar13);
    piVar17 = (int *)&stack0xffffff94;
    if (local_40 == (undefined1 *)0x0) goto LAB_00a15c40;
  }
  else {
    local_70 = 0xa15576;
    (**(code **)(*(int *)this + 0x20))();
    piVar17 = &local_70;
    if (local_40 == (undefined1 *)0x0) {
      local_40 = &DAT_00d539c2;
      piVar17 = &local_70;
    }
  }
  piVar15 = piVar17;
  iVar10 = *(int *)this;
  piVar15[1] = (int)local_40;
  *piVar15 = (int)this;
  pcVar5 = *(code **)(iVar10 + 0x70);
  piVar15[-1] = 0xa15592;
  (*pcVar5)();
  *piVar15 = (int)this;
  piVar15[-1] = 0xa1559a;
  iVar10 = CBaseEntity::GetGender((CBaseEntity *)*piVar15);
  if (iVar10 == 0xe) {
    *piVar15 = TheZombieManager;
    piVar15[-1] = 0xa15cad;
    ZombieManager::OnFallenSurvivorSpawned((ZombieManager *)*piVar15);
    *piVar15 = TheZombieManager;
    piVar15[-1] = 0xa15cba;
    cVar8 = ZombieManager::IsFallenSurvivorAllowed((ZombieManager *)*piVar15);
    if (cVar8 == '\0') {
LAB_00a15c40:
      *piVar15 = (int)this;
      piVar15[-1] = 0xa15c48;
      UTIL_Remove((CBaseEntity *)*piVar15);
      return;
    }
  }
  *piVar15 = (int)this;
  piVar15[-1] = 0xa155ab;
  NextBotCombatCharacter::Spawn((NextBotCombatCharacter *)*piVar15);
  piVar15[1] = 0;
  *piVar15 = (int)this;
  piVar15[-1] = 0xa155bb;
  CBaseEntity::SetGlobalFadeScale((CBaseEntity *)*piVar15,(float)piVar15[1]);
  iVar10 = *(int *)this;
  *piVar15 = (int)this;
  pcVar5 = *(code **)(iVar10 + 0x544);
  piVar15[-1] = 0xa155c6;
  iVar10 = (*pcVar5)();
  if (iVar10 != 2) {
    piVar15[1] = *(int *)(sv_infected_scale_max._28_4_ + 0x2c);
    *piVar15 = *(undefined4 *)(sv_infected_scale_min._28_4_ + 0x2c);
    piVar15[-1] = 0xa155ef;
    lVar18 = (longdouble)RandomFloat();
    piVar15[2] = 0;
    *piVar15 = (int)this;
    piVar15[1] = (int)(float)lVar18;
    piVar15[-1] = 0xa1560d;
    CBaseAnimating::SetModelScale((CBaseAnimating *)*piVar15,(float)piVar15[1],(float)piVar15[2]);
  }
  piVar15[3] = 0;
  *piVar15 = (int)(this + 0x194);
  piVar15[2] = 0;
  piVar15[1] = 7;
  piVar15[-1] = 0xa15633;
  CCollisionProperty::SetSurroundingBoundsType();
  pIVar1 = this + 0x100;
  iVar10 = (int)*(float *)(ZombieHealth._28_4_ + 0x2c);
  if (iVar10 != *(int *)(this + 0x100)) {
    iVar11 = *(int *)this;
    piVar15[1] = (int)pIVar1;
    *piVar15 = (int)this;
    pcVar5 = *(code **)(iVar11 + 0x214);
    piVar15[-1] = 0xa15663;
    (*pcVar5)();
    uVar14 = ZombieHealth._28_4_;
    *(int *)(this + 0x100) = iVar10;
    iVar10 = (int)*(float *)(uVar14 + 0x2c);
  }
  pIVar2 = this + 0xfc;
  if (*(int *)(this + 0xfc) != iVar10) {
    iVar11 = *(int *)this;
    piVar15[1] = (int)pIVar2;
    *piVar15 = (int)this;
    pcVar5 = *(code **)(iVar11 + 0x20c);
    piVar15[-1] = 0xa15699;
    (*pcVar5)();
    *(int *)(this + 0xfc) = iVar10;
  }
  if (this[0x105] != (Infected)0x2) {
    iVar10 = *(int *)this;
    *piVar15 = (int)this;
    piVar15[1] = (int)(this + 0x105);
    pcVar5 = *(code **)(iVar10 + 0x224);
    piVar15[-1] = 0xa156bd;
    (*pcVar5)();
    this[0x105] = (Infected)0x2;
  }
  if (this[0x1cbd] != (Infected)0x0) {
    if (this[0x6c] == (Infected)0x0) {
      puVar6 = *(uint **)(this + 0x30);
      if (puVar6 != (uint *)0x0) {
        *puVar6 = *puVar6 | 0x101;
        *piVar15 = (int)puVar6;
        piVar15[-1] = 0xa15d59;
        iVar10 = CBaseEdict::GetChangeAccessor((CBaseEdict *)*piVar15);
        *(undefined2 *)(iVar10 + 2) = 0;
      }
    }
    else {
      this[0x70] = (Infected)((byte)this[0x70] | 1);
    }
    this[0x1cbd] = (Infected)0x0;
  }
  if (this[0x1cd4] != (Infected)0x0) {
    if (this[0x6c] == (Infected)0x0) {
      puVar6 = *(uint **)(this + 0x30);
      if (puVar6 != (uint *)0x0) {
        *puVar6 = *puVar6 | 0x101;
        *piVar15 = (int)puVar6;
        piVar15[-1] = 0xa15d1f;
        iVar10 = CBaseEdict::GetChangeAccessor((CBaseEdict *)*piVar15);
        *(undefined2 *)(iVar10 + 2) = 0;
      }
    }
    else {
      this[0x70] = (Infected)((byte)this[0x70] | 1);
    }
    this[0x1cd4] = (Infected)0x0;
  }
  piVar7 = mdlcache;
  this[0x1cbe] = (Infected)0x0;
  iVar10 = *piVar7;
  *piVar15 = (int)piVar7;
  pcVar5 = *(code **)(iVar10 + 0x68);
  piVar15[-1] = 0xa156f7;
  (*pcVar5)();
  piVar17 = *(int **)(this + 0x13e0);
  if (piVar17 == (int *)0x0) {
    *piVar15 = (int)this;
                    /* try { // try from 00a1609b to 00a160ab has its CatchHandler @ 00a161b0 */
    piVar15[-1] = 0xa160a0;
    iVar10 = CBaseEntity::GetModel((CBaseEntity *)*piVar15);
    if (iVar10 != 0) {
      *piVar15 = (int)this;
      piVar15[-1] = 0xa160ac;
      CBaseAnimating::LockStudioHdr((CBaseAnimating *)*piVar15);
    }
    piVar17 = *(int **)(this + 0x13e0);
    if (piVar17 != (int *)0x0) goto LAB_00a15705;
  }
  else {
LAB_00a15705:
    iVar10 = *piVar17;
    if ((iVar10 != 0) && (*(int *)(z_randomskins._28_4_ + 0x30) != 0)) {
      if (*(int *)(z_infected_damage_cutouts._28_4_ + 0x30) == 0) {
        iVar10 = *(int *)(iVar10 + 0xe0);
        *piVar15 = 0;
        piVar15[1] = iVar10 + -1;
                    /* try { // try from 00a15bfc to 00a15c00 has its CatchHandler @ 00a161b0 */
        piVar15[-1] = 0xa15c01;
        RandomInt();
      }
      else {
        iVar10 = *(int *)(iVar10 + 0xe0);
        *piVar15 = 0;
        iVar11 = iVar10 + -1;
        iVar10 = iVar10 + 2;
        if (-1 < iVar11) {
          iVar10 = iVar11;
        }
        piVar15[1] = iVar10 >> 2;
                    /* try { // try from 00a159ee to 00a15a24 has its CatchHandler @ 00a161b0 */
        piVar15[-1] = 0xa159f3;
        iVar10 = RandomInt();
        if (iVar10 * 4 - *(int *)(this + 0x458) != 0) {
          if (this[0x6c] == (Infected)0x0) {
            puVar6 = *(uint **)(this + 0x30);
            if (puVar6 != (uint *)0x0) {
              *puVar6 = *puVar6 | 0x101;
              *piVar15 = (int)puVar6;
              piVar15[-1] = 0xa15a25;
              iVar11 = CBaseEdict::GetChangeAccessor((CBaseEdict *)*piVar15);
              *(undefined2 *)(iVar11 + 2) = 0;
            }
          }
          else {
            this[0x70] = (Infected)((byte)this[0x70] | 1);
          }
          *(int *)(this + 0x458) = iVar10 * 4;
        }
      }
    }
  }
  piVar15[1] = 0;
  piVar15[2] = (int)&local_34;
  *piVar15 = (int)&local_30;
  local_30 = 0;
  local_2c = 0;
  local_28 = 0;
  local_24 = 0;
  local_20 = 0;
  local_34 = "Head";
                    /* try { // try from 00a1575b to 00a159ac has its CatchHandler @ 00a161c5 */
  piVar15[-1] = 0xa15760;
  CUtlVector<char_const*,CUtlMemory<char_const*,int>>::InsertBefore
            ((CUtlVector<char_const*,CUtlMemory<char_const*,int>> *)*piVar15,piVar15[1],
             (char **)piVar15[2]);
  if (*(int *)(z_randombodygroups._28_4_ + 0x30) != 0) {
    piVar15[1] = (int)&local_30;
    *piVar15 = (int)this;
    piVar15[-1] = 0xa15994;
    CBaseAnimating::RandomizeBodygroups((CBaseAnimating *)*piVar15,(CUtlVector *)piVar15[1]);
  }
  piVar15[2] = (int)&local_34;
  piVar15[1] = 0;
  *piVar15 = (int)&local_30;
  local_24 = 0;
  local_34 = "UpperBody";
  piVar15[-1] = 0xa15792;
  CUtlVector<char_const*,CUtlMemory<char_const*,int>>::InsertBefore
            ((CUtlVector<char_const*,CUtlMemory<char_const*,int>> *)*piVar15,piVar15[1],
             (char **)piVar15[2]);
  if (*(int *)(z_randombodygroups._28_4_ + 0x30) != 0) {
    piVar15[1] = (int)&local_30;
    *piVar15 = (int)this;
    piVar15[-1] = 0xa1597c;
    CBaseAnimating::RandomizeBodygroups((CBaseAnimating *)*piVar15,(CUtlVector *)piVar15[1]);
  }
  piVar15[2] = (int)&local_34;
  piVar15[1] = 0;
  *piVar15 = (int)&local_30;
  local_24 = 0;
  local_34 = "LowerBody";
  piVar15[-1] = 0xa157c4;
  CUtlVector<char_const*,CUtlMemory<char_const*,int>>::InsertBefore
            ((CUtlVector<char_const*,CUtlMemory<char_const*,int>> *)*piVar15,piVar15[1],
             (char **)piVar15[2]);
  if (*(int *)(z_randombodygroups._28_4_ + 0x30) != 0) {
    piVar15[1] = (int)&local_30;
    *piVar15 = (int)this;
    piVar15[-1] = 0xa15964;
    CBaseAnimating::RandomizeBodygroups((CBaseAnimating *)*piVar15,(CUtlVector *)piVar15[1]);
  }
  *piVar15 = (int)this;
  piVar15[-1] = 0xa157dc;
  RandomizeColor((Infected *)*piVar15);
  piVar15[1] = 0;
  *piVar15 = (int)this;
  piVar15[-1] = 0xa157ec;
  CBaseEntity::SetAIWalkable((CBaseEntity *)*piVar15,SUB41(piVar15[1],0));
  iVar10 = *(int *)this;
  piVar15[1] = 3;
  *piVar15 = (int)this;
  pcVar5 = *(code **)(iVar10 + 0x194);
  piVar15[-1] = 0xa157ff;
  (*pcVar5)();
  this[0x1cbc] = (Infected)0x0;
  iVar10 = 0;
  do {
    piVar15[1] = iVar10;
    *piVar15 = (int)this;
    piVar15[-1] = 0xa1581c;
    iVar11 = CBaseAnimatingOverlay::GetAnimOverlay((CBaseAnimatingOverlay *)*piVar15,piVar15[1]);
    if (iVar11 != 0) {
      piVar15[1] = (int)this;
      *piVar15 = iVar11;
      piVar15[-1] = 0xa1582c;
      CAnimationLayer::Init((CAnimationLayer *)*piVar15,(CBaseAnimatingOverlay *)piVar15[1]);
    }
    iVar10 = iVar10 + 1;
  } while (iVar10 != 6);
  piVar15[2] = (int)"head";
  piVar15[1] = (int)"head";
  *piVar15 = (int)this;
  piVar15[-1] = 0xa1584c;
  SetIdleBodyGroupVariant((char *)*piVar15,(char *)piVar15[1]);
  iVar10 = *(int *)(this + 0x45c);
  if (iVar10 != *(int *)(this + 0x1ce8)) {
    if (this[0x6c] == (Infected)0x0) {
      puVar6 = *(uint **)(this + 0x30);
      if (puVar6 != (uint *)0x0) {
        *puVar6 = *puVar6 | 0x101;
        *piVar15 = (int)puVar6;
        piVar15[-1] = 0xa15879;
        iVar11 = CBaseEdict::GetChangeAccessor((CBaseEdict *)*piVar15);
        *(undefined2 *)(iVar11 + 2) = 0;
      }
    }
    else {
      this[0x70] = (Infected)((byte)this[0x70] | 1);
    }
    *(int *)(this + 0x1ce8) = iVar10;
  }
  piVar15[1] = 0x2000;
  *piVar15 = (int)this;
  piVar15[-1] = 0xa15895;
  CBaseEntity::AddFlag((CBaseEntity *)*piVar15,piVar15[1]);
  piVar15[1] = 0x10000;
  *piVar15 = (int)this;
  piVar15[-1] = 0xa158a5;
  CBaseEntity::AddFlag((CBaseEntity *)*piVar15,piVar15[1]);
  if (*(float *)(this + 0x1cc4) != -1.0) {
    iVar10 = *(int *)(this + 0x1cc0);
    *piVar15 = (int)(this + 0x1cc0);
    piVar15[1] = (int)(this + 0x1cc4);
    pcVar5 = *(code **)(iVar10 + 4);
    piVar15[-1] = 0xa158d2;
    (*pcVar5)();
    *(undefined4 *)(this + 0x1cc4) = 0xbf800000;
  }
  *(undefined4 *)(this + 0x1cf0) = 0;
  iVar10 = *(int *)this;
  *piVar15 = (int)this;
  pcVar5 = *(code **)(iVar10 + 0x544);
  piVar15[-1] = 0xa158f1;
  iVar10 = (*pcVar5)();
  if (iVar10 == 0) {
    *piVar15 = TheDirector;
    piVar15[-1] = 0xa159ad;
    uVar12 = CDirector::GetAdditionalInfectedFlags((CDirector *)*piVar15);
    *(uint *)(this + 0x1c74) = *(uint *)(this + 0x1c74) | uVar12;
  }
  *piVar15 = (int)this;
  piVar15[-1] = 0xa15901;
  iVar10 = CBaseEntity::GetGender((CBaseEntity *)*piVar15);
  if (iVar10 == 0xb) {
    *(uint *)(this + 0x1c74) = *(uint *)(this + 0x1c74) | 2;
    iVar10 = *random_valve;
    piVar15[2] = 0x3f800000;
    piVar15[1] = 0;
    *piVar15 = (int)random_valve;
                    /* try { // try from 00a15d91 to 00a16037 has its CatchHandler @ 00a161c5 */
    pcVar5 = *(code **)(iVar10 + 4);
    piVar15[-1] = 0xa15d94;
    lVar18 = (longdouble)(*pcVar5)();
    if ((float)lVar18 < *(float *)(sv_infected_ceda_vomitjar_probability._28_4_ + 0x2c))
    goto LAB_00a15dab;
    goto LAB_00a15ea0;
  }
  *piVar15 = (int)this;
  piVar15[-1] = 0xa15912;
  iVar10 = CBaseEntity::GetGender((CBaseEntity *)*piVar15);
  if (iVar10 == 0xc) {
    uVar12 = *(uint *)(this + 0x1c74) | 4;
    *(uint *)(this + 0x1c74) = uVar12;
    goto joined_r0x00a15eaa;
  }
  *piVar15 = (int)this;
  piVar15[-1] = 0xa15923;
  iVar10 = CBaseEntity::GetGender((CBaseEntity *)*piVar15);
  if (iVar10 == 0xd) {
    uVar12 = *(uint *)(this + 0x1c74) | 8;
    *(uint *)(this + 0x1c74) = uVar12;
    goto joined_r0x00a15eaa;
  }
  *piVar15 = (int)this;
  piVar15[-1] = 0xa15934;
  iVar10 = CBaseEntity::GetGender((CBaseEntity *)*piVar15);
  if (iVar10 == 0xe) {
    uVar12 = *(uint *)(this + 0x1c74) | 0x10;
    *(uint *)(this + 0x1c74) = uVar12;
    goto joined_r0x00a15eaa;
  }
  *piVar15 = (int)this;
  piVar15[-1] = 0xa15e00;
  iVar10 = CBaseEntity::GetGender((CBaseEntity *)*piVar15);
  if (iVar10 == 0xf) {
    *(uint *)(this + 0x1c74) = *(uint *)(this + 0x1c74) | 0x20;
    iVar10 = *random_valve;
    piVar15[2] = 0x3f800000;
    piVar15[1] = 0;
    *piVar15 = (int)random_valve;
    pcVar5 = *(code **)(iVar10 + 4);
    piVar15[-1] = 0xa1618b;
    lVar18 = (longdouble)(*pcVar5)();
    if ((float)lVar18 < *(float *)(sv_infected_riot_control_tonfa_probability._28_4_ + 0x2c)) {
LAB_00a15dab:
      uVar12 = *(uint *)(this + 0x1c78) | 1;
      if (*(uint *)(this + 0x1c78) != uVar12) {
        if (this[0x6c] == (Infected)0x0) {
          puVar6 = *(uint **)(this + 0x30);
          if (puVar6 != (uint *)0x0) {
            *puVar6 = *puVar6 | 0x101;
            *piVar15 = (int)puVar6;
            piVar15[-1] = 0xa15ddd;
            iVar10 = CBaseEdict::GetChangeAccessor((CBaseEdict *)*piVar15);
            *(undefined2 *)(iVar10 + 2) = 0;
          }
        }
        else {
          this[0x70] = (Infected)((byte)this[0x70] | 1);
        }
        *(uint *)(this + 0x1c78) = uVar12;
        uVar12 = *(uint *)(this + 0x1c74);
        goto joined_r0x00a15eaa;
      }
    }
  }
  else {
    *piVar15 = (int)this;
    piVar15[-1] = 0xa15e11;
    iVar10 = CBaseEntity::GetGender((CBaseEntity *)*piVar15);
    if (iVar10 == 0x14) {
      iVar10 = *random_valve;
      piVar15[2] = 0x3f800000;
      piVar15[1] = 0;
      *piVar15 = (int)random_valve;
      pcVar5 = *(code **)(iVar10 + 4);
      piVar15[-1] = 0xa16122;
      lVar18 = (longdouble)(*pcVar5)();
      if ((float)lVar18 < *(float *)(sv_infected_police_tonfa_probability._28_4_ + 0x2c))
      goto LAB_00a15dab;
    }
    else {
      *piVar15 = (int)this;
      piVar15[-1] = 0xa15e22;
      iVar10 = CBaseEntity::GetGender((CBaseEntity *)*piVar15);
      if (iVar10 == 0x11) {
        *(uint *)(this + 0x1c74) = *(uint *)(this + 0x1c74) | 10;
        piVar15[-1] = 0xa15e33;
        iVar10 = GetDifficulty();
        if (0 < iVar10) {
          iVar10 = *(int *)this;
          *piVar15 = (int)this;
          pcVar5 = *(code **)(iVar10 + 0x1fc);
          piVar15[-1] = 0xa15e42;
          iVar10 = (*pcVar5)();
          if ((int)((float)iVar10 * 20.0) != *(int *)(this + 0xfc)) {
            iVar11 = *(int *)this;
            *piVar15 = (int)this;
            piVar15[1] = (int)pIVar2;
            pcVar5 = *(code **)(iVar11 + 0x20c);
            piVar15[-1] = 0xa15e6c;
            (*pcVar5)();
            *(int *)(this + 0xfc) = (int)((float)iVar10 * 20.0);
          }
          iVar10 = *(int *)this;
          *piVar15 = (int)this;
          pcVar5 = *(code **)(iVar10 + 0x1fc);
          piVar15[-1] = 0xa15e7d;
          iVar10 = (*pcVar5)();
          if (iVar10 != *(int *)(this + 0x100)) {
            iVar11 = *(int *)this;
            *piVar15 = (int)this;
            piVar15[1] = (int)pIVar1;
            pcVar5 = *(code **)(iVar11 + 0x214);
            piVar15[-1] = 0xa15e99;
            (*pcVar5)();
            *(int *)(this + 0x100) = iVar10;
          }
        }
      }
    }
  }
LAB_00a15ea0:
  uVar12 = *(uint *)(this + 0x1c74);
joined_r0x00a15eaa:
  if ((uVar12 & 0x10) != 0) {
    *(uint *)(this + 0x1c74) = uVar12 & 0xfffff7ff | 0x40b;
    iVar10 = *(int *)this;
    *piVar15 = (int)this;
    pcVar5 = *(code **)(iVar10 + 0x1fc);
    piVar15[-1] = 0xa15ec9;
    iVar10 = (*pcVar5)();
    iVar10 = (int)((float)iVar10 * *(float *)(sv_fallen_survivor_health_multiplier._28_4_ + 0x2c));
    if (iVar10 != *(int *)(this + 0xfc)) {
      iVar11 = *(int *)this;
      *piVar15 = (int)this;
      piVar15[1] = (int)pIVar2;
      pcVar5 = *(code **)(iVar11 + 0x20c);
      piVar15[-1] = 0xa15ef5;
      (*pcVar5)();
      *(int *)(this + 0xfc) = iVar10;
    }
    iVar10 = *(int *)this;
    *piVar15 = (int)this;
    pcVar5 = *(code **)(iVar10 + 0x1fc);
    piVar15[-1] = 0xa15f06;
    iVar10 = (*pcVar5)();
    if (iVar10 != *(int *)(this + 0x100)) {
      iVar11 = *(int *)this;
      *piVar15 = (int)this;
      piVar15[1] = (int)pIVar1;
      pcVar5 = *(code **)(iVar11 + 0x214);
      piVar15[-1] = 0xa15f22;
      (*pcVar5)();
      *(int *)(this + 0x100) = iVar10;
    }
    piVar15[-1] = 0xa15f2d;
    uVar14 = GetMapInfo();
    piVar17 = (int *)&DAT_00f1c800;
    local_44 = 0;
    do {
      piVar15[1] = *piVar17;
      *piVar15 = *(undefined4 *)(TheDirector + 0x648);
      piVar15[-1] = 0xa15f55;
      cVar8 = CDirectorChallengeMode::AllowWeaponSpawn();
      if (cVar8 != '\0') {
        piVar15[1] = *piVar17;
        *piVar15 = *(undefined4 *)(TheDirector + 0x648);
        piVar15[-1] = 0xa15f91;
        cVar8 = CDirectorChallengeMode::AllowFallenSurvivorItem();
        if (cVar8 != '\0') {
          iVar10 = *piVar17;
          if (iVar10 == 0xd) {
LAB_00a15ff9:
            uVar12 = 1 << ((byte)local_44 & 0x1f) | *(uint *)(this + 0x1c78);
            if (*(uint *)(this + 0x1c78) != uVar12) {
              if (this[0x6c] == (Infected)0x0) {
                puVar6 = *(uint **)(this + 0x30);
                if (puVar6 != (uint *)0x0) {
                  *puVar6 = *puVar6 | 0x101;
                  *piVar15 = (int)puVar6;
                  piVar15[-1] = 0xa16038;
                  iVar10 = CBaseEdict::GetChangeAccessor((CBaseEdict *)*piVar15);
                  *(undefined2 *)(iVar10 + 2) = 0;
                }
              }
              else {
                this[0x70] = (Infected)((byte)this[0x70] | 1);
              }
              *(uint *)(this + 0x1c78) = uVar12;
            }
          }
          else if (iVar10 < 0xe) {
            if (iVar10 == 0xc) {
              *piVar15 = *(undefined4 *)(TheDirector + 0x648);
              piVar15[-1] = 0xa1615a;
              cVar8 = CDirectorChallengeMode::TempHealthOnly((CDirectorChallengeMode *)*piVar15);
              if (cVar8 == '\0') goto LAB_00a15fb4;
            }
          }
          else if (iVar10 == 0xe) {
            *piVar15 = uVar14;
                    /* try { // try from 00a160ce to 00a1618a has its CatchHandler @ 00a161c5 */
            piVar15[-1] = 0xa160d3;
            lVar18 = (longdouble)CMapInfo::GetPipeBombDensity((CMapInfo *)*piVar15);
            piVar15[1] = 0x40400000;
            *piVar15 = 0;
            piVar15[-1] = 0xa160ea;
            lVar19 = (longdouble)RandomFloat();
            if ((float)lVar19 < (float)lVar18) goto LAB_00a15ff9;
          }
          else if (iVar10 == 0xf) {
LAB_00a15fb4:
            *piVar15 = uVar14;
            piVar15[-1] = 0xa15fbf;
            lVar18 = (longdouble)CMapInfo::GetPainPillDensity((CMapInfo *)*piVar15);
            piVar15[1] = 0x40400000;
            *piVar15 = 0;
            piVar15[-1] = 0xa15fd6;
            lVar19 = (longdouble)RandomFloat();
            if ((float)lVar19 < (float)lVar18) {
              piVar15[-1] = 0xa15ff1;
              cVar8 = CTerrorGameRules::HasPlayerControlledZombies();
              if (cVar8 == '\0') goto LAB_00a15ff9;
            }
          }
        }
      }
      local_44 = local_44 + 1;
      piVar17 = piVar17 + 0x61;
    } while (local_44 != 4);
    uVar12 = *(uint *)(this + 0x1c74);
  }
  *(uint *)(this + 0x1c74) = uVar12 | 0x40;
  piVar15[1] = 0x40000000;
  *piVar15 = 0x3f800000;
                    /* try { // try from 00a15a71 to 00a15b96 has its CatchHandler @ 00a161c5 */
  piVar15[-1] = 0xa15a76;
  lVar18 = (longdouble)RandomFloat();
  pIVar3 = this + 0x1cfc;
  fVar4 = (float)lVar18;
  *piVar15 = (int)pIVar3;
  piVar15[-1] = 0xa15a87;
  lVar18 = (longdouble)CountdownTimer::Now();
  if ((float)lVar18 + fVar4 != *(float *)(this + 0x1d04)) {
    iVar10 = *(int *)(this + 0x1cfc);
    *piVar15 = (int)pIVar3;
    piVar15[1] = (int)(this + 0x1d04);
                    /* try { // try from 00a15ce3 to 00a15ce5 has its CatchHandler @ 00a161c5 */
    pcVar5 = *(code **)(iVar10 + 4);
    piVar15[-1] = 0xa15ce6;
    (*pcVar5)();
    *(float *)(this + 0x1d04) = (float)lVar18 + fVar4;
  }
  if (fVar4 != *(float *)(this + 0x1d00)) {
    iVar10 = *(int *)(this + 0x1cfc);
    *piVar15 = (int)pIVar3;
    piVar15[1] = (int)(this + 0x1d00);
                    /* try { // try from 00a15c63 to 00a15c65 has its CatchHandler @ 00a161c5 */
    pcVar5 = *(code **)(iVar10 + 4);
    piVar15[-1] = 0xa15c66;
    (*pcVar5)();
    *(float *)(this + 0x1d00) = fVar4;
  }
  *piVar15 = (int)this;
  piVar15[-1] = 0xa15ac0;
  iVar10 = CBaseEntity::GetGender((CBaseEntity *)*piVar15);
  if (iVar10 - 0xbU < 7) {
    *piVar15 = (int)this;
    piVar15[-1] = 0xa15ad4;
    iVar10 = CBaseEntity::GetGender((CBaseEntity *)*piVar15);
    if (iVar10 != 0xf) {
      *piVar15 = (int)this;
      piVar15[-1] = 0xa15ae5;
      iVar10 = CBaseEntity::GetGender((CBaseEntity *)*piVar15);
      if (iVar10 != 0xe) {
        piVar15[-1] = 0xa15aef;
        iVar10 = GetDifficulty();
        if (0 < iVar10) {
          iVar10 = *(int *)this;
          *piVar15 = (int)this;
          pcVar5 = *(code **)(iVar10 + 0x1fc);
          piVar15[-1] = 0xa15afe;
          iVar10 = (*pcVar5)();
          if ((int)((float)iVar10 * 3.0) != *(int *)(this + 0xfc)) {
            iVar11 = *(int *)this;
            *piVar15 = (int)this;
            piVar15[1] = (int)pIVar2;
            pcVar5 = *(code **)(iVar11 + 0x20c);
            piVar15[-1] = 0xa15b28;
            (*pcVar5)();
            *(int *)(this + 0xfc) = (int)((float)iVar10 * 3.0);
          }
          iVar10 = *(int *)this;
          *piVar15 = (int)this;
          pcVar5 = *(code **)(iVar10 + 0x1fc);
          piVar15[-1] = 0xa15b39;
          iVar10 = (*pcVar5)();
          if (iVar10 != *(int *)(this + 0x100)) {
            iVar11 = *(int *)this;
            *piVar15 = (int)this;
            piVar15[1] = (int)pIVar1;
            pcVar5 = *(code **)(iVar11 + 0x214);
            piVar15[-1] = 0xa15b55;
            (*pcVar5)();
            *(int *)(this + 0x100) = iVar10;
          }
        }
      }
    }
  }
  *(undefined4 *)(this + 0x1d84) = 0xffffffff;
  if (*(float *)(this + 0x1d80) != -1.0) {
    iVar10 = *(int *)(this + 0x1d78);
    *piVar15 = (int)(this + 0x1d78);
    piVar15[1] = (int)(this + 0x1d80);
    pcVar5 = *(code **)(iVar10 + 4);
    piVar15[-1] = 0xa15b97;
    (*pcVar5)();
    *(undefined4 *)(this + 0x1d80) = 0xbf800000;
  }
  *piVar15 = (int)&local_30;
  local_24 = 0;
  piVar15[-1] = 0xa15bb0;
  CUtlMemory<char_const*,int>::Purge((CUtlMemory<char_const*,int> *)*piVar15);
  *piVar15 = (int)&local_30;
  local_20 = local_30;
  piVar15[-1] = 0xa15bbe;
  CUtlMemory<char_const*,int>::Purge((CUtlMemory<char_const*,int> *)*piVar15);
  iVar10 = *piVar7;
  *piVar15 = (int)piVar7;
  pcVar5 = *(code **)(iVar10 + 0x6c);
  piVar15[-1] = 0xa15bc9;
  (*pcVar5)();
  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)