L L4D2node

CDirectorMusicBanks::OnRoundStart

0x008b2320 · 586 bytes · __thiscall

_ZN19CDirectorMusicBanks12OnRoundStartEv

Decompiled

undefined (1 param)

/* CDirectorMusicBanks::OnRoundStart() */

void __thiscall CDirectorMusicBanks::OnRoundStart(CDirectorMusicBanks *this)

{
  float fVar1;
  float fVar2;
  char cVar3;
  KeyValues *this_00;
  IBaseFileSystem *pIVar4;
  longdouble lVar5;
  uint in_stack_ffffffa8;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  
  cVar3 = CDirector::IsCheckpointStart(TheDirector);
  if (cVar3 == '\0') {
    this_00 = KeyValues::operator_new((KeyValues *)0x2c,in_stack_ffffffa8);
                    /* try { // try from 008b236a to 008b236e has its CatchHandler @ 008b25ad */
    KeyValues::KeyValues(this_00,"game_sounds_music.txt",(IKeyValuesSystem *)0x0,false);
    pIVar4 = (IBaseFileSystem *)0x0;
    if (filesystem != 0) {
      pIVar4 = (IBaseFileSystem *)(filesystem + 4);
    }
    cVar3 = KeyValues::LoadFromFile(this_00,pIVar4,"scripts/game_sounds_music.txt",(char *)0x0);
    if (cVar3 != '\0') {
      local_30 = 0;
      local_2c = 0;
      local_28 = 0;
      local_24 = 0;
      local_20 = 0;
                    /* try { // try from 008b23d0 to 008b23f2 has its CatchHandler @ 008b2583 */
      CollectMusicBanks("Event.DisturbingAtmosphere",this_00,(CUtlVector *)(this + 4));
      CollectMusicBanks("Event.MomentOfSilence",this_00,(CUtlVector *)(this + 0x1c));
      CollectMusicBanks("Event.Reveal",this_00,(CUtlVector *)(this + 0x34));
      *(undefined4 *)(this + 0x18) = 0;
      *(undefined4 *)(this + 0x30) = 0;
      *(undefined4 *)(this + 0x48) = 0;
      local_24 = 0;
      CUtlMemory<string_t,int>::Purge((CUtlMemory<string_t,int> *)&local_30);
      local_20 = local_30;
      CUtlMemory<string_t,int>::Purge((CUtlMemory<string_t,int> *)&local_30);
    }
    KeyValues::deleteThis();
    lVar5 = (longdouble)
            RandomFloat(*(undefined4 *)(MusicBankMinDuration._28_4_ + 0x2c),
                        *(undefined4 *)(MusicBankMaxDuration._28_4_ + 0x2c));
    fVar2 = (float)lVar5;
    lVar5 = (longdouble)CountdownTimer::Now();
    if ((float)lVar5 + fVar2 == *(float *)(this + 0x54)) {
      fVar1 = *(float *)(this + 0x50);
    }
    else {
      (**(code **)(*(int *)(this + 0x4c) + 4))(this + 0x4c,this + 0x54);
      fVar1 = *(float *)(this + 0x50);
      *(float *)(this + 0x54) = (float)lVar5 + fVar2;
    }
    if (fVar2 != fVar1) {
      (**(code **)(*(int *)(this + 0x4c) + 4))(this + 0x4c,this + 0x50);
      *(float *)(this + 0x50) = fVar2;
      return;
    }
  }
  else {
    fVar2 = *(float *)(this + 0x58);
    lVar5 = (longdouble)CountdownTimer::Now();
    if ((float)lVar5 + fVar2 == *(float *)(this + 0x54)) {
      fVar1 = *(float *)(this + 0x50);
    }
    else {
      (**(code **)(*(int *)(this + 0x4c) + 4))(this + 0x4c,this + 0x54);
      fVar1 = *(float *)(this + 0x50);
      *(float *)(this + 0x54) = (float)lVar5 + fVar2;
    }
    if (fVar2 != fVar1) {
      (**(code **)(*(int *)(this + 0x4c) + 4))(this + 0x4c,this + 0x50);
      *(float *)(this + 0x50) = fVar2;
      return;
    }
  }
  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)