L L4D2node

PhysParseSurfaceData

0x00493170 · 299 bytes · __cdecl

_Z20PhysParseSurfaceDataP20IPhysicsSurfacePropsP11IFileSystem

Decompiled

undefined (2 params)

/* PhysParseSurfaceData(IPhysicsSurfaceProps*, IFileSystem*) */

void PhysParseSurfaceData(IPhysicsSurfaceProps *param_1,IFileSystem *param_2)

{
  char cVar1;
  KeyValues *pKVar2;
  IBaseFileSystem *pIVar3;
  char *pcVar4;
  int iVar5;
  undefined4 uVar6;
  uint in_stack_ffffffc8;
  
  pKVar2 = KeyValues::operator_new((KeyValues *)0x2c,in_stack_ffffffc8);
                    /* try { // try from 004931ac to 004931b0 has its CatchHandler @ 004932a4 */
  KeyValues::KeyValues(pKVar2,SURFACEPROP_MANIFEST_FILE,(IKeyValuesSystem *)0x0,false);
  pIVar3 = (IBaseFileSystem *)0x0;
  if (param_2 != (IFileSystem *)0x0) {
    pIVar3 = (IBaseFileSystem *)(param_2 + 4);
  }
  cVar1 = KeyValues::LoadFromFile(pKVar2,pIVar3,SURFACEPROP_MANIFEST_FILE,"GAME");
  if (cVar1 == '\0') {
    Error("Unable to load manifest file \'%s\'\n",SURFACEPROP_MANIFEST_FILE);
    KeyValues::deleteThis();
    return;
  }
  for (pKVar2 = (KeyValues *)KeyValues::GetFirstSubKey(pKVar2); pKVar2 != (KeyValues *)0x0;
      pKVar2 = (KeyValues *)KeyValues::GetNextKey(pKVar2)) {
    pcVar4 = (char *)KeyValues::GetName(pKVar2);
    iVar5 = _V_stricmp(pcVar4,"file");
    if (iVar5 == 0) {
      pcVar4 = (char *)KeyValues::GetString(pKVar2,(char *)0x0,"");
      AddSurfacepropFile(pcVar4,param_1,param_2);
    }
    else {
      uVar6 = KeyValues::GetName(pKVar2);
      Warning("surfaceprops::Init:  Manifest \'%s\' with bogus file type \'%s\', expecting \'file\'\n"
              ,SURFACEPROP_MANIFEST_FILE,uVar6);
    }
  }
  KeyValues::deleteThis();
  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)