L L4D2node

Script_PrecacheItemFromTable

0x00b46ed0 · 155 bytes · __cdecl

_ZL28Script_PrecacheItemFromTableP9HSCRIPT__

Decompiled

undefined (1 param)

/* Script_PrecacheItemFromTable(HSCRIPT__*) */

undefined4 Script_PrecacheItemFromTable(HSCRIPT__ *param_1)

{
  undefined4 uVar1;
  CBaseEntity *pCVar2;
  char *local_28 [2];
  undefined2 local_20;
  ushort local_1e;
  
  local_20 = 0;
  local_1e = 0;
  local_28[0] = (char *)0x0;
                    /* try { // try from 00b46f0c to 00b46f6f has its CatchHandler @ 00b46f72 */
  uVar1 = (**(code **)(*g_pScriptVM + 0x90))(g_pScriptVM,param_1,"classname",local_28);
  if ((char)uVar1 == '\0') {
    DevWarning("Hey - your spawntable doesn\'t have a classname");
  }
  else {
    pCVar2 = (CBaseEntity *)VScript_ParseEntity(local_28[0],param_1);
    if (pCVar2 != (CBaseEntity *)0x0) {
      DispatchSpawn(pCVar2,false);
      UTIL_Remove(pCVar2);
      goto LAB_00b46f26;
    }
  }
  uVar1 = 0;
LAB_00b46f26:
  if ((local_1e & 1) != 0) {
    free(local_28[0]);
  }
  return uVar1;
}

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)