L L4D2node

PrecacheInfectedModels

0x00a144f0 · 1152 bytes · __cdecl

_Z22PrecacheInfectedModelsP14CBaseAnimatingP10CUtlVectorIPKc10CUtlMemoryIS3_iEES7_

Decompiled

undefined (3 params)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* PrecacheInfectedModels(CBaseAnimating*, CUtlVector<char const*, CUtlMemory<char const*, int> >*,
   CUtlVector<char const*, CUtlMemory<char const*, int> >*) */

void PrecacheInfectedModels(CBaseAnimating *param_1,CUtlVector *param_2,CUtlVector *param_3)

{
  uint *puVar1;
  char cVar2;
  int *piVar3;
  KeyValues *pKVar4;
  char *pcVar5;
  int iVar6;
  int iVar7;
  bool local_39;
  char *local_38;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_28;
  undefined4 local_24;
  int local_20;
  
  local_34 = 0;
  local_30 = 0;
  if (_towlower == 0) {
    local_20 = 0;
  }
  else {
    (**(code **)(_towlower + 0x50))
              (_towlower,&local_34,0,0,0,0,
               "/data/src/game/server/terror/zombiebot/infected/infected.cpp",0x245,
               &PrecacheInfectedModels(CBaseAnimating*,CUtlVector<char_const*,CUtlMemory<char_const*,int>>*,CUtlVector<char_const*,CUtlMemory<char_const*,int>>*)
                ::tm_fmt,"(%s)%s","ZOMBIE","PrecacheInfectedModels");
    local_20 = _towlower;
  }
  iVar6 = _DAT_0105db00;
  local_28 = local_34;
  local_24 = local_30;
                    /* try { // try from 00a14816 to 00a14876 has its CatchHandler @ 00a1497f */
  if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
     (iVar7 = ThreadGetCurrentId(), iVar6 == iVar7)) {
    if ((char *)*_DAT_0105d15c != "PrecacheInfectedModels") {
      _DAT_0105d15c =
           (int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xd1ff04,(char *)0x0,0xc0db47);
    }
    puVar1 = (uint *)(_DAT_0105d1e8 + 4 + _DAT_0105d15c[0x1c] * 8);
    *puVar1 = *puVar1 | 4;
    CVProfNode::EnterScope();
    DAT_0105d158 = '\0';
  }
  local_39 = false;
                    /* try { // try from 00a145ac to 00a14762 has its CatchHandler @ 00a14994 */
  ConVar::Revert((ConVar *)ZombiePopulation);
  piVar3 = (int *)CNavMesh::GetPlacesFromNavFile(TheNavMesh,&local_39);
  pKVar4 = (KeyValues *)CDirector::GetPopulationData(TheDirector);
  if (pKVar4 == (KeyValues *)0x0) {
                    /* try { // try from 00a148b2 to 00a148b6 has its CatchHandler @ 00a14994 */
    Msg("Failed to get population data\n");
LAB_00a148b7:
    iVar6 = _DAT_0105db00;
    if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
       (iVar7 = ThreadGetCurrentId(), iVar6 == iVar7)) {
      cVar2 = CVProfNode::ExitScope();
      if (cVar2 != '\0') {
        _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
      }
      DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
    }
    if (local_20 == 0) {
      return;
    }
    (**(code **)(local_20 + 0x54))(local_20,local_28,local_24,0,0,0);
    return;
  }
  if (((local_39 != false) || (piVar3 == (int *)0x0)) || (iVar6 = piVar3[3], iVar6 == 0)) {
    pcVar5 = "FCVAR_NEVER_AS_STRING";
    if ((ZombiePopulation[0x15] & 0x10) == 0) {
      pcVar5 = "";
      if (*(char **)(ZombiePopulation._28_4_ + 0x24) != (char *)0x0) {
        pcVar5 = *(char **)(ZombiePopulation._28_4_ + 0x24);
      }
    }
                    /* try { // try from 00a147f6 to 00a147fa has its CatchHandler @ 00a14994 */
    PrecacheInfectedFromPlace(param_1,pcVar5,pKVar4,param_2,param_3);
    if (piVar3 == (int *)0x0) goto LAB_00a148b7;
    iVar6 = piVar3[3];
  }
  iVar7 = 0;
  if (0 < iVar6) {
    do {
      pcVar5 = (char *)CNavMesh::PlaceToName(TheNavMesh,*(uint *)(*piVar3 + iVar7 * 4));
      PrecacheInfectedFromPlace(param_1,pcVar5,pKVar4,param_2,param_3);
      iVar7 = iVar7 + 1;
    } while (iVar7 < piVar3[3]);
  }
  pcVar5 = *(char **)(gpGlobals + 0x3c);
  if (pcVar5 == (char *)0x0) {
    pcVar5 = "";
LAB_00a1465e:
    iVar6 = _V_stricmp(pcVar5,"c1m4_atrium");
    if (iVar6 != 0) goto LAB_00a14763;
  }
  else if (pcVar5 != "c1m4_atrium") goto LAB_00a1465e;
  CBaseEntity::PrecacheModel("models/infected/common_male_jimmy.mdl");
  local_38 = operator_new__(0x26);
  builtin_strncpy(local_38,"models/infected/common_male_jimmy.mdl",0x26);
  CUtlVector<char_const*,CUtlMemory<char_const*,int>>::InsertBefore
            ((CUtlVector<char_const*,CUtlMemory<char_const*,int>> *)param_2,*(int *)(param_2 + 0xc),
             &local_38);
  local_38 = operator_new__(0x26);
  builtin_strncpy(local_38,"models/infected/common_male_jimmy.mdl",0x26);
  CUtlVector<char_const*,CUtlMemory<char_const*,int>>::InsertBefore
            ((CUtlVector<char_const*,CUtlMemory<char_const*,int>> *)param_3,*(int *)(param_3 + 0xc),
             &local_38);
LAB_00a14763:
  iVar6 = _DAT_0105db00;
  if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
     (iVar7 = ThreadGetCurrentId(), iVar6 == iVar7)) {
    cVar2 = CVProfNode::ExitScope();
    if (cVar2 != '\0') {
      _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
    }
    DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
  }
  if (local_20 != 0) {
    (**(code **)(local_20 + 0x54))(local_20,local_28,local_24,0,0,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)