L L4D2node

CMapListManager::BuildList

0x0017f000 · 380 bytes · __thiscall

_ZN15CMapListManager9BuildListEv

Decompiled

undefined (1 param)

/* CMapListManager::BuildList() */

void __thiscall CMapListManager::BuildList(CMapListManager *this)

{
  undefined4 uVar1;
  char *pcVar2;
  int iVar3;
  int in_GS_OFFSET;
  undefined4 local_f4;
  undefined4 local_f0;
  char *local_ec;
  undefined4 local_e8;
  undefined4 local_e4;
  char local_e0 [96];
  char local_80 [96];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  CUtlDict<CMapListItem,int>::RemoveAll((CUtlDict<CMapListItem,int> *)this);
  this[0x28] = (CMapListManager)0x0;
  V_snprintf(local_e0,0x60,"maps/*.%sbsp",&DAT_002c79d4);
  pcVar2 = (char *)Sys_FindFirst(local_e0,(char *)0x0,0);
  while (pcVar2 != (char *)0x0) {
    iVar3 = V_stristr(pcVar2,".360.bsp");
    if (iVar3 == 0) {
      V_snprintf(local_80,0x60,"maps/%s",pcVar2);
      local_f0 = 0;
      local_f4 = 1;
      local_f0 = (**(code **)(*(int *)(g_pFileSystem + 4) + 0x34))(g_pFileSystem + 4,local_80,0);
      local_f4 = 1;
      local_e8 = 1;
      local_e4 = 0;
      local_ec = local_80;
      iVar3 = CUtlRBTree<CUtlMap<char_const*,CMapListItem,int>::Node_t,int,CUtlMap<char_const*,CMapListItem,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,CMapListItem,int>::Node_t,int>,int>>
              ::Find((CUtlRBTree<CUtlMap<char_const*,CMapListItem,int>::Node_t,int,CUtlMap<char_const*,CMapListItem,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,CMapListItem,int>::Node_t,int>,int>>
                      *)this,(Node_t *)&local_ec);
      if (iVar3 == -1) {
        CUtlDict<CMapListItem,int>::Insert
                  ((CUtlDict<CMapListItem,int> *)this,local_80,(CMapListItem *)&local_f4);
      }
    }
    pcVar2 = (char *)Sys_FindNext((char *)0x0,0);
  }
  Sys_FindClose();
  uVar1 = realtime;
  this[0x28] = (CMapListManager)0x1;
  iVar3 = *(int *)(in_GS_OFFSET + 0x14);
  *(undefined4 *)(this + 0x24) = uVar1;
  if (local_20 == iVar3) {
    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)