L L4D2node

CDirectorScavengeMode::UpdateMusicIntensity

0x008b3000 · 222 bytes · __thiscall

_ZN21CDirectorScavengeMode20UpdateMusicIntensityEv

Decompiled

undefined (1 param)

/* CDirectorScavengeMode::UpdateMusicIntensity() */

void __thiscall CDirectorScavengeMode::UpdateMusicIntensity(CDirectorScavengeMode *this)

{
  int iVar1;
  int iVar2;
  CInfoDirector *this_00;
  int iVar3;
  longdouble lVar4;
  int local_10;
  
  lVar4 = (longdouble)CTerrorGameRules::GetRemainingAccumulatedTime(g_pGameRules);
  iVar3 = (int)lVar4;
  if ((float)iVar3 < (float)lVar4) {
    iVar3 = iVar3 + 1;
  }
  if (*(int *)(this + 0x28) == 0) {
    *(undefined4 *)(this + 0x28) = 0xb;
    iVar2 = 10;
  }
  else {
    iVar2 = *(int *)(this + 0x28) + -1;
    if (iVar2 < 1) {
      return;
    }
  }
  while ((iVar1 = iVar2 + -1,
         *(int *)(UpdateMusicIntensity()::s_iMusicIntensityCheckpoints + iVar1 * 4 + 4) < iVar3 ||
         (iVar3 <= *(int *)(UpdateMusicIntensity()::s_iMusicIntensityCheckpoints + iVar1 * 4)))) {
    iVar2 = iVar1;
    if (iVar1 < 1) {
      return;
    }
  }
  *(int *)(this + 0x28) = iVar2;
  local_10 = iVar2;
  ForEachTerrorPlayer<ScavengeIntensityLevelChange>((ScavengeIntensityLevelChange *)&local_10);
  iVar3 = CGlobalEntityList::FindEntityByClassname
                    ((CGlobalEntityList *)gEntList,(CBaseEntity *)0x0,"info_director");
  if (iVar3 == 0) {
    return;
  }
  this_00 = (CInfoDirector *)__dynamic_cast(iVar3,&CBaseEntity::typeinfo,&CInfoDirector::typeinfo,0)
  ;
  if (this_00 == (CInfoDirector *)0x0) {
    return;
  }
  CInfoDirector::OnScavengeIntensityChanged(this_00,iVar2);
  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)