L L4D2node

CDirectorScriptedEventManager::PlayMegaMobWarningSounds

0x008bbc90 · 335 bytes · __cdecl

_ZN29CDirectorScriptedEventManager24PlayMegaMobWarningSoundsEv

Decompiled

undefined (0 params)

/* CDirectorScriptedEventManager::PlayMegaMobWarningSounds() */

void CDirectorScriptedEventManager::PlayMegaMobWarningSounds(void)

{
  CBaseEntity *this;
  code *pcVar1;
  char cVar2;
  int iVar3;
  int iVar4;
  CAI_Concept local_48 [8];
  undefined4 local_40;
  undefined4 local_3c;
  undefined4 local_38;
  undefined4 local_34;
  int local_30 [8];
  
  iVar3 = CDirector::GetCommonInfectedLimit(TheDirector);
  if (iVar3 == 0) {
    return;
  }
  local_30[0] = 0;
  local_30[1] = 0;
  local_30[2] = 0;
  local_30[3] = 0;
  local_30[4] = 0;
  local_40 = 0xffffffff;
  local_3c = 7;
  local_38 = 3;
  local_34 = 9;
                    /* try { // try from 008bbcfd to 008bbdb4 has its CatchHandler @ 008bbde9 */
  ForEachPlayer<PlayerCollector>((PlayerCollector *)&local_40);
  if (0 < local_30[3]) {
    iVar3 = 0;
LAB_008bbd24:
    do {
      this = *(CBaseEntity **)(local_30[0] + iVar3 * 4);
      CBaseEntity::EmitSound(this,"MegaMobIncoming",0.0,(float *)0x0);
      cVar2 = (**(code **)(*(int *)this + 300))(this);
      if (cVar2 != '\0') {
        iVar4 = CBaseEntity::GetTeamNumber(this);
        if (iVar4 == 2) {
          pcVar1 = *(code **)(*(int *)this + 0x7b4);
          CAI_Concept::CAI_Concept(local_48,"PlayerWarnMegaMob");
          (*pcVar1)(this,local_48,1,0,0,0,0);
          iVar3 = iVar3 + 1;
          if (local_30[3] <= iVar3) break;
          goto LAB_008bbd24;
        }
      }
      iVar3 = iVar3 + 1;
    } while (iVar3 < local_30[3]);
  }
  local_30[3] = 0;
  CUtlMemory<CTerrorPlayer*,int>::Purge((CUtlMemory<CTerrorPlayer*,int> *)local_30);
  local_30[4] = local_30[0];
  CUtlMemory<CTerrorPlayer*,int>::Purge((CUtlMemory<CTerrorPlayer*,int> *)local_30);
  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)