L L4D2node

MapEntity_PrecacheEntity

0x006f1030 · 184 bytes · __cdecl

_Z24MapEntity_PrecacheEntityPKcRi

Decompiled

undefined (2 params)

/* MapEntity_PrecacheEntity(char const*, int&) */

void MapEntity_PrecacheEntity(char *param_1,int *param_2)

{
  char cVar1;
  CBaseEntity *this;
  int in_GS_OFFSET;
  char *local_81c;
  int local_818;
  char *local_814;
  char local_810 [2048];
  int local_10;
  
  local_10 = *(int *)(in_GS_OFFSET + 0x14);
  local_818 = *param_2;
  local_81c = param_1;
  local_814 = param_1;
  cVar1 = CEntityMapData::ExtractValue((CEntityMapData *)&local_81c,"classname",local_810);
  if (cVar1 == '\0') {
    Error("classname missing from entity!\n");
  }
  this = (CBaseEntity *)CreateEntityByName(local_810,-1,true);
  if (this != (CBaseEntity *)0x0) {
    CBaseEntity::ParseMapData(this,(CEntityMapData *)&local_81c);
    (**(code **)(*(int *)this + 0x6c))(this);
    UTIL_RemoveImmediate(this);
  }
  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}

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)