L L4D2node

CTerrorGameRules::CleanUpMap

0x00503be0 · 394 bytes · __thiscall

_ZN16CTerrorGameRules10CleanUpMapEv

Decompiled

undefined (1 param)

/* CTerrorGameRules::CleanUpMap() */

void __thiscall CTerrorGameRules::CleanUpMap(CTerrorGameRules *this)

{
  int iVar1;
  char cVar2;
  CBaseEntity *pCVar3;
  int *piVar4;
  char *pcVar5;
  int iVar6;
  undefined **local_14;
  uint local_10;
  
  if (*(char *)(TheDirector + 0x28f) == '\0') {
    return;
  }
  cVar2 = CCSGameRules::IsLogoMap((CCSGameRules *)this);
  if (cVar2 == '\0') {
    CDirectorChallengeMode::RemoveScriptSpawnedEntities
              (*(CDirectorChallengeMode **)(TheDirector + 0x648));
    for (pCVar3 = (CBaseEntity *)
                  CGlobalEntityList::NextEnt((CGlobalEntityList *)gEntList,(CBaseEntity *)0x0);
        pCVar3 != (CBaseEntity *)0x0;
        pCVar3 = (CBaseEntity *)CGlobalEntityList::NextEnt((CGlobalEntityList *)gEntList,pCVar3)) {
      piVar4 = (int *)__dynamic_cast(pCVar3,&CBaseEntity::typeinfo,&CWeaponCSBase::typeinfo,0);
      if (piVar4 == (int *)0x0) {
        pcVar5 = *(char **)(pCVar3 + 0x7c);
        if (pcVar5 == (char *)0x0) {
          pcVar5 = "";
        }
        cVar2 = FindInList((char **)s_TerrorPreserveEnts,pcVar5);
        if ((cVar2 == '\0') && (cVar2 = Commentary_IsCommentaryEntity(pCVar3), cVar2 == '\0'))
        goto LAB_00503c99;
      }
      else {
        cVar2 = (**(code **)(*piVar4 + 0x5f8))(piVar4);
        if (cVar2 != '\0') {
LAB_00503c99:
          UTIL_Remove(pCVar3);
        }
      }
    }
    iVar6 = 0;
    CGlobalEntityList::CleanupDeleteList();
    (**(code **)(*engine + 0x17c))(engine);
    CEventQueue::Clear((CEventQueue *)g_EventQueue);
    if (0 < DAT_00fe6000) {
      do {
        iVar1 = iVar6 * 4;
        iVar6 = iVar6 + 1;
        CNavArea::UnblockArea(*(CNavArea **)(TheNavAreas + iVar1));
      } while (iVar6 < DAT_00fe6000);
    }
    (**(code **)(*(int *)this + 0x1e0))(this);
    local_10 = (uint)DAT_00fe3114;
    local_14 = &PTR_ShouldCreateEntity_00c2a998;
    pcVar5 = (char *)(**(code **)(*engine + 0x11c))(engine);
    MapEntity_ParseAllEntities(pcVar5,(IMapEntityFilter *)&local_14,true);
    ApplyCommentaryModifications();
  }
  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)