L L4D2node

MapEntity_ParseAllEntites_SpawnTemplates

0x006f0810 · 900 bytes · __cdecl

_Z40MapEntity_ParseAllEntites_SpawnTemplatesPP14CPointTemplateiPP11CBaseEntityP26HierarchicalSpawnMapData_ti

Decompiled

undefined (5 params)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* MapEntity_ParseAllEntites_SpawnTemplates(CPointTemplate**, int, CBaseEntity**,
   HierarchicalSpawnMapData_t*, int) */

void MapEntity_ParseAllEntites_SpawnTemplates
               (CPointTemplate **param_1,int param_2,CBaseEntity **param_3,
               HierarchicalSpawnMapData_t *param_4,int param_5)

{
  CBaseEntity *this;
  char cVar1;
  int iVar2;
  int iVar3;
  CBaseEntity *pCVar4;
  CBaseEntity **ppCVar5;
  undefined1 *puVar6;
  int local_4c;
  int local_40;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_28;
  undefined4 local_24;
  int local_20;
  
  if (0 < param_2) {
    local_4c = 0;
    do {
      local_34 = 0;
      local_30 = 0;
      if (___atan2f_finite == 0) {
        local_20 = 0;
      }
      else {
        (**(code **)(___atan2f_finite + 0x50))
                  (___atan2f_finite,&local_34,0,0,0,0,"/data/src/game/server/mapentities.cpp",0x19f,
                   &MapEntity_ParseAllEntites_SpawnTemplates(CPointTemplate**,int,CBaseEntity**,HierarchicalSpawnMapData_t*,int)
                    ::tm_fmt,"(%s)%s","Unaccounted","MapEntity_ParseAllEntities_SpawnTemplates");
        local_20 = ___atan2f_finite;
      }
      iVar3 = _DAT_0105db00;
      local_28 = local_34;
      local_24 = local_30;
                    /* try { // try from 006f08d4 to 006f08d8 has its CatchHandler @ 006f0bbb */
      if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
         (iVar2 = ThreadGetCurrentId(), iVar3 == iVar2)) {
        if ((char *)*_DAT_0105d15c != "MapEntity_ParseAllEntities_SpawnTemplates") {
                    /* try { // try from 006f0b1e to 006f0b2f has its CatchHandler @ 006f0bbb */
          _DAT_0105d15c =
               (int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xc9ce90,(char *)0x1,0xbfafa1);
        }
        CVProfNode::EnterScope();
        DAT_0105d158 = '\0';
      }
      this = (CBaseEntity *)param_1[local_4c];
                    /* try { // try from 006f08f8 to 006f098b has its CatchHandler @ 006f0b9a */
      iVar3 = DispatchSpawn(this,true);
      if (iVar3 < 0) {
        UTIL_Remove(this);
        puVar6 = gEntList;
        CGlobalEntityList::CleanupDeleteList();
        iVar3 = _DAT_0105db00;
        if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
           (iVar2 = ThreadGetCurrentId(puVar6), iVar3 == iVar2)) {
          cVar1 = CVProfNode::ExitScope();
          if (cVar1 != '\0') {
            _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
          }
          DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
        }
        if (local_20 != 0) {
          (**(code **)(local_20 + 0x54))(local_20,local_28,local_24,0,0,0);
        }
      }
      else {
        CPointTemplate::StartBuildingTemplates((CPointTemplate *)this);
        iVar3 = CPointTemplate::GetNumTemplateEntities((CPointTemplate *)this);
        if (0 < iVar3) {
          local_40 = 0;
          do {
            while (pCVar4 = (CBaseEntity *)
                            CPointTemplate::GetTemplateEntity((CPointTemplate *)this,local_40),
                  param_5 < 1) {
LAB_006f0975:
              local_40 = local_40 + 1;
              if (local_40 == iVar3) goto LAB_006f0981;
            }
            ppCVar5 = param_3;
            if (pCVar4 == *param_3) {
              iVar2 = 0;
            }
            else {
              iVar2 = 0;
              do {
                ppCVar5 = ppCVar5 + 1;
                iVar2 = iVar2 + 1;
                if (iVar2 == param_5) goto LAB_006f0975;
              } while (pCVar4 != *ppCVar5);
              iVar2 = iVar2 * 8;
            }
                    /* try { // try from 006f0a1d to 006f0a8c has its CatchHandler @ 006f0b9a */
            CPointTemplate::AddTemplate
                      ((CPointTemplate *)this,pCVar4,*(char **)(param_4 + iVar2),
                       *(int *)(param_4 + iVar2 + 4));
            cVar1 = CPointTemplate::ShouldRemoveTemplateEntities((CPointTemplate *)this);
            if (cVar1 == '\0') goto LAB_006f0975;
            UTIL_Remove(pCVar4);
            CGlobalEntityList::CleanupDeleteList();
            local_40 = local_40 + 1;
            *ppCVar5 = (CBaseEntity *)0x0;
          } while (local_40 != iVar3);
        }
LAB_006f0981:
        CPointTemplate::FinishBuildingTemplates((CPointTemplate *)this);
        iVar3 = _DAT_0105db00;
        if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
           (iVar2 = ThreadGetCurrentId(), iVar3 == iVar2)) {
          cVar1 = CVProfNode::ExitScope();
          if (cVar1 != '\0') {
            _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
          }
          DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
        }
        if (local_20 != 0) {
          (**(code **)(local_20 + 0x54))(local_20,local_28,local_24,0,0,0);
        }
      }
      local_4c = local_4c + 1;
    } while (local_4c != param_2);
  }
  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)