L L4D2node

PrecacheInfectedFromPlace

0x00a14270 · 619 bytes · __cdecl

_Z25PrecacheInfectedFromPlaceP14CBaseAnimatingPKcP9KeyValuesP10CUtlVectorIS2_10CUtlMemoryIS2_iEES9_

Decompiled

undefined (5 params)

/* PrecacheInfectedFromPlace(CBaseAnimating*, char const*, KeyValues*, CUtlVector<char const*,
   CUtlMemory<char const*, int> >*, CUtlVector<char const*, CUtlMemory<char const*, int> >*) */

void PrecacheInfectedFromPlace
               (CBaseAnimating *param_1,char *param_2,KeyValues *param_3,CUtlVector *param_4,
               CUtlVector *param_5)

{
  char cVar1;
  KeyValues *pKVar2;
  char *pcVar3;
  int iVar4;
  int iVar5;
  size_t sVar6;
  char *pcVar7;
  int in_GS_OFFSET;
  char *local_130;
  CFmtStrN<256> local_12c [5];
  char local_127 [263];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  pKVar2 = (KeyValues *)KeyValues::FindKey(param_3,param_2,false);
  if (pKVar2 == (KeyValues *)0x0) {
    pcVar3 = "FCVAR_NEVER_AS_STRING";
    if ((ZombiePopulation[0x15] & 0x10) == 0) {
      pcVar3 = "";
      if (*(char **)(ZombiePopulation._28_4_ + 0x24) != (char *)0x0) {
        pcVar3 = *(char **)(ZombiePopulation._28_4_ + 0x24);
      }
    }
    pKVar2 = (KeyValues *)KeyValues::FindKey(param_3,pcVar3,false);
  }
  if ((pKVar2 == (KeyValues *)0x0) || (param_4 == (CUtlVector *)0x0)) {
    pcVar3 = "FCVAR_NEVER_AS_STRING";
    if ((ZombiePopulation[0x15] & 0x10) == 0) {
      pcVar3 = "";
      if (*(char **)(ZombiePopulation._28_4_ + 0x24) != (char *)0x0) {
        pcVar3 = *(char **)(ZombiePopulation._28_4_ + 0x24);
      }
    }
    Msg("No area population for %s\n",pcVar3);
  }
  else {
    for (pKVar2 = (KeyValues *)KeyValues::GetFirstSubKey(pKVar2); pKVar2 != (KeyValues *)0x0;
        pKVar2 = (KeyValues *)KeyValues::GetNextKey(pKVar2)) {
      pcVar3 = (char *)KeyValues::GetName(pKVar2);
      iVar4 = V_strnicmp(pcVar3,"common",6);
      if (iVar4 == 0) {
        CFmtStrN<256>::CFmtStrN(local_12c,"models/infected/%s.mdl",pcVar3);
        if (*(int *)(param_4 + 0xc) < 1) {
LAB_00a143ea:
          CBaseEntity::PrecacheModel(local_127);
          sVar6 = strlen(local_127);
          pcVar7 = operator_new__(sVar6 + 1);
          strcpy(pcVar7,local_127);
          local_130 = pcVar7;
          CUtlVector<char_const*,CUtlMemory<char_const*,int>>::InsertBefore
                    ((CUtlVector<char_const*,CUtlMemory<char_const*,int>> *)param_4,
                     *(int *)(param_4 + 0xc),&local_130);
          cVar1 = CDirector::IsInfectedModelAllowedInLowViolence(TheDirector,pcVar3);
          if (cVar1 != '\0') {
            sVar6 = strlen(local_127);
            pcVar3 = operator_new__(sVar6 + 1);
            strcpy(pcVar3,local_127);
            local_130 = pcVar3;
            CUtlVector<char_const*,CUtlMemory<char_const*,int>>::InsertBefore
                      ((CUtlVector<char_const*,CUtlMemory<char_const*,int>> *)param_5,
                       *(int *)(param_5 + 0xc),&local_130);
          }
        }
        else {
          pcVar7 = (char *)**(undefined4 **)param_4;
          if (pcVar7 != local_127) {
            iVar4 = 0;
            do {
              iVar5 = _V_stricmp(pcVar7,local_127);
              if (iVar5 == 0) break;
              iVar4 = iVar4 + 1;
              if (*(int *)(param_4 + 0xc) <= iVar4) goto LAB_00a143ea;
              pcVar7 = *(char **)(*(int *)param_4 + iVar4 * 4);
            } while (pcVar7 != local_127);
          }
        }
      }
    }
  }
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  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)