L L4D2node

CPropData::ParsePropDataFile

0x00499620 · 427 bytes · __thiscall

_ZN9CPropData17ParsePropDataFileEv

Decompiled

undefined (1 param)

/* CPropData::ParsePropDataFile() */

void __thiscall CPropData::ParsePropDataFile(CPropData *this)

{
  undefined4 *puVar1;
  char cVar2;
  KeyValues *pKVar3;
  IBaseFileSystem *pIVar4;
  int iVar5;
  char *pcVar6;
  uint in_stack_ffffffb8;
  KeyValues *local_38;
  undefined4 local_30 [4];
  char *local_20 [4];
  
  pKVar3 = KeyValues::operator_new((KeyValues *)0x2c,in_stack_ffffffb8);
                    /* try { // try from 00499652 to 00499656 has its CatchHandler @ 004997cb */
  KeyValues::KeyValues(pKVar3,"PropDatafile",(IKeyValuesSystem *)0x0,false);
  iVar5 = filesystem;
  *(KeyValues **)(this + 0xc) = pKVar3;
  pIVar4 = (IBaseFileSystem *)0x0;
  if (iVar5 != 0) {
    pIVar4 = (IBaseFileSystem *)(iVar5 + 4);
  }
  cVar2 = KeyValues::LoadFromFile(pKVar3,pIVar4,"scripts/propdata.txt",(char *)0x0);
  if (cVar2 != '\0') {
    this[0x10] = (CPropData)0x1;
    pKVar3 = (KeyValues *)KeyValues::FindKey(*(KeyValues **)(this + 0xc),"BreakableModels",false);
    if ((pKVar3 != (KeyValues *)0x0) &&
       (local_38 = (KeyValues *)KeyValues::GetFirstSubKey(pKVar3), local_38 != (KeyValues *)0x0)) {
      do {
        iVar5 = CUtlVector<CPropData::propdata_breakablechunk_t,CUtlMemory<CPropData::propdata_breakablechunk_t,int>>
                ::InsertBefore((CUtlVector<CPropData::propdata_breakablechunk_t,CUtlMemory<CPropData::propdata_breakablechunk_t,int>>
                                *)(this + 0x14),*(int *)(this + 0x20));
        puVar1 = (undefined4 *)(*(int *)(this + 0x14) + iVar5 * 0x18);
        KeyValues::GetName(local_38);
        AllocPooledString((char *)local_30);
        *puVar1 = local_30[0];
        pKVar3 = (KeyValues *)KeyValues::GetFirstSubKey(local_38);
        for (; pKVar3 != (KeyValues *)0x0; pKVar3 = (KeyValues *)KeyValues::GetNextKey(pKVar3)) {
          KeyValues::GetName(pKVar3);
          AllocPooledString((char *)local_20);
          CUtlVector<string_t,CUtlMemory<string_t,int>>::InsertBefore
                    ((CUtlVector<string_t,CUtlMemory<string_t,int>> *)(puVar1 + 1),puVar1[4],
                     (string_t *)local_20);
          pcVar6 = local_20[0];
          if (local_20[0] == (char *)0x0) {
            pcVar6 = "";
          }
          CBaseEntity::PrecacheModel(pcVar6);
        }
        local_38 = (KeyValues *)KeyValues::GetNextKey(local_38);
      } while (local_38 != (KeyValues *)0x0);
    }
    return;
  }
  KeyValues::deleteThis();
  *(undefined4 *)(this + 0xc) = 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)