L L4D2node

MapEntity_ParseAllEntities

0x006f18b0 · 779 bytes · __cdecl

_Z26MapEntity_ParseAllEntitiesPKcP16IMapEntityFilterb

Decompiled

undefined (3 params)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* MapEntity_ParseAllEntities(char const*, IMapEntityFilter*, bool) */

void MapEntity_ParseAllEntities(char *param_1,IMapEntityFilter *param_2,bool param_3)

{
  int iVar1;
  char cVar2;
  char *pcVar3;
  char *pcVar4;
  int iVar5;
  int in_GS_OFFSET;
  CMapEntitySpawner *this;
  CBaseEntity *local_1060;
  undefined4 local_105c;
  undefined4 local_1058;
  undefined4 local_1050;
  undefined4 local_104c;
  CMapEntitySpawner *local_1048;
  CMapEntitySpawner local_1044 [8];
  HierarchicalSpawn_t *local_103c;
  int local_1024;
  char local_1020 [2048];
  char local_820 [2048];
  int local_20;
  
  local_105c = 0;
  local_1058 = 0;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if (___atan2f_finite == (CMapEntitySpawner *)0x0) {
    local_1048 = (CMapEntitySpawner *)0x0;
  }
  else {
    (**(code **)(___atan2f_finite + 0x50))
              (___atan2f_finite,&local_105c,0,0,0,0,"/data/src/game/server/mapentities.cpp",0x1ee,
               &MapEntity_ParseAllEntities(char_const*,IMapEntityFilter*,bool)::tm_fmt,"(%s)%s",
               "Unaccounted","MapEntity_ParseAllEntities");
    local_1048 = ___atan2f_finite;
  }
  iVar1 = _DAT_0105db00;
  local_1050 = local_105c;
  local_104c = local_1058;
                    /* try { // try from 006f1a6e to 006f1abc has its CatchHandler @ 006f1bff */
  if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
     (iVar5 = ThreadGetCurrentId(), iVar1 == iVar5)) {
    if (*(char **)_DAT_0105d15c != "MapEntity_ParseAllEntities") {
      _DAT_0105d15c =
           (CMapEntitySpawner *)
           CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xc9cdd1,(char *)0x1,0xbfafa1);
    }
    CVProfNode::EnterScope();
    DAT_0105d158 = '\0';
  }
                    /* try { // try from 006f19a5 to 006f19a9 has its CatchHandler @ 006f1bfb */
  CMapEntitySpawner::CMapEntitySpawner(local_1044);
  if (serverenginetools != (int *)0x0) {
                    /* try { // try from 006f19bc to 006f1a59 has its CatchHandler @ 006f1bc9 */
    param_1 = (char *)(**(code **)(*serverenginetools + 0x24))(serverenginetools,param_1);
  }
  while (pcVar3 = (char *)MapEntity_ParseToken(param_1,local_820), pcVar3 != (char *)0x0) {
    if (local_820[0] == '{') {
      pcVar4 = (char *)MapEntity_ParseEntity(&local_1060,pcVar3,param_2);
      if (local_1060 != (CBaseEntity *)0x0) {
        CMapEntitySpawner::AddEntity(local_1044,local_1060,pcVar3,(int)(pcVar4 + (2 - (int)pcVar3)))
        ;
      }
    }
    else {
      Error("MapEntity_ParseAllEntities: found %s when expecting {",local_820);
      pcVar4 = pcVar3;
    }
    param_1 = (char *)MapEntity_SkipToNextEntity(pcVar4,local_1020);
  }
                    /* try { // try from 006f1ad9 to 006f1b00 has its CatchHandler @ 006f1bc9 */
  CMapEntitySpawner::HandleTemplates(local_1044);
  SpawnHierarchicalList(local_1024,local_103c,param_3);
  this = local_1044;
  CMapEntitySpawner::~CMapEntitySpawner(this);
  iVar1 = _DAT_0105db00;
  if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
     (iVar5 = ThreadGetCurrentId(), iVar1 == iVar5)) {
    this = _DAT_0105d15c;
    cVar2 = CVProfNode::ExitScope();
    if (cVar2 != '\0') {
      _DAT_0105d15c = *(CMapEntitySpawner **)(_DAT_0105d15c + 100);
    }
    DAT_0105d158 = _DAT_0105d15c == (CMapEntitySpawner *)0x105d160;
  }
  if (local_1048 != (CMapEntitySpawner *)0x0) {
    this = local_1048;
    (**(code **)(local_1048 + 0x54))(local_1048,local_1050,local_104c,0,0,0);
  }
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail(this);
  }
  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)