L L4D2node

CDirectorMusicBanks::UpdateMusic

0x008b1fd0 · 288 bytes · __thiscall

_ZN19CDirectorMusicBanks11UpdateMusicEv

Decompiled

undefined (1 param)

/* CDirectorMusicBanks::UpdateMusic() */

void __thiscall CDirectorMusicBanks::UpdateMusic(CDirectorMusicBanks *this)

{
  float fVar1;
  int iVar2;
  longdouble lVar3;
  
  lVar3 = (longdouble)CountdownTimer::Now();
  if (*(float *)(this + 0x54) <= (float)lVar3) {
    lVar3 = (longdouble)
            RandomFloat(*(undefined4 *)(MusicBankMinDuration._28_4_ + 0x2c),
                        *(undefined4 *)(MusicBankMaxDuration._28_4_ + 0x2c));
    fVar1 = (float)lVar3;
    lVar3 = (longdouble)CountdownTimer::Now();
    if ((float)lVar3 + fVar1 != *(float *)(this + 0x54)) {
      (**(code **)(*(int *)(this + 0x4c) + 4))(this + 0x4c,this + 0x54);
      *(float *)(this + 0x54) = (float)lVar3 + fVar1;
    }
    if (fVar1 != *(float *)(this + 0x50)) {
      (**(code **)(*(int *)(this + 0x4c) + 4))(this + 0x4c,this + 0x50);
      *(float *)(this + 0x50) = fVar1;
    }
    iVar2 = *(int *)(this + 0x18);
    *(int *)(this + 0x18) = iVar2 + 1;
    if (*(int *)(this + 0x10) <= iVar2 + 1) {
      ShuffleMusicNoDuplicates((CUtlVector *)(this + 4));
      *(undefined4 *)(this + 0x18) = 0;
    }
    iVar2 = *(int *)(this + 0x30);
    *(int *)(this + 0x30) = iVar2 + 1;
    if (*(int *)(this + 0x28) <= iVar2 + 1) {
      ShuffleMusicNoDuplicates((CUtlVector *)(this + 0x1c));
      *(undefined4 *)(this + 0x30) = 0;
    }
    iVar2 = *(int *)(this + 0x48);
    *(int *)(this + 0x48) = iVar2 + 1;
    if (*(int *)(this + 0x40) <= iVar2 + 1) {
      ShuffleMusicNoDuplicates((CUtlVector *)(this + 0x34));
      *(undefined4 *)(this + 0x48) = 0;
      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)