L L4D2node

CDirectorScavengeMode::OnScavengeRoundStarted

0x008b35f0 · 600 bytes · __thiscall

_ZN21CDirectorScavengeMode22OnScavengeRoundStartedEv.part.91

Decompiled

undefined (1 param)

/* CDirectorScavengeMode::OnScavengeRoundStarted() [clone .part.91] */

void __thiscall CDirectorScavengeMode::OnScavengeRoundStarted(CDirectorScavengeMode *this)

{
  code *pcVar1;
  CTerrorGameRules *this_00;
  int in_EAX;
  undefined1 *puVar2;
  int *piVar3;
  int iVar4;
  CInfoDirector *this_01;
  int in_GS_OFFSET;
  longdouble lVar5;
  ScavengeRoundStart local_111;
  char local_110 [256];
  int local_10;
  
  local_10 = *(int *)(in_GS_OFFSET + 0x14);
  DevMsg("%3.2f: Director::OnScavengeRoundStarted: Scavenge started.\n",
         (double)*(float *)(gpGlobals + 0xc));
  puVar2 = &DAT_00d539c2;
  if (*(undefined1 **)(gpGlobals + 0x3c) != (undefined1 *)0x0) {
    puVar2 = *(undefined1 **)(gpGlobals + 0x3c);
  }
  V_snprintf(local_110,0x100,"%s_scavenge",puVar2);
  CDirector::RunScript(TheDirector,local_110,1,0);
  if (*(float *)(in_EAX + 0x18) != -1.0) {
    (**(code **)(*(int *)(in_EAX + 0x10) + 4))(in_EAX + 0x10,in_EAX + 0x18);
    *(undefined4 *)(in_EAX + 0x18) = 0xbf800000;
  }
  this_00 = g_pGameRules;
  *(undefined1 *)(in_EAX + 8) = 1;
  *(undefined4 *)(in_EAX + 0x28) = 0;
  *(undefined4 *)(in_EAX + 4) = 0;
  *(undefined1 *)(in_EAX + 0xc) = 0;
  if (this_00 != (CTerrorGameRules *)0x0) {
    CTerrorGameRules::SetRoundStartTime(this_00,*(float *)(gpGlobals + 0xc));
    CTerrorGameRules::ClearAccumulatedTime(g_pGameRules);
    lVar5 = (longdouble)
            CDirector::GetScriptValue
                      (TheDirector,"ScavengeRoundInitialTime",
                       *(float *)(scavenge_round_initial_time._28_4_ + 0x2c));
    CTerrorGameRules::AccumulateTime(g_pGameRules,(float)lVar5);
  }
  ForEachTerrorPlayer<ScavengeRoundStart>(&local_111);
  piVar3 = (int *)(**(code **)(*gameeventmanager + 0x1c))
                            (gameeventmanager,"scavenge_round_start",0,0);
  if (piVar3 != (int *)0x0) {
    pcVar1 = *(code **)(*piVar3 + 0x30);
    CTerrorGameRules::GetRoundNumber(g_pGameRules);
    (*pcVar1)(piVar3,"round");
    (**(code **)(*piVar3 + 0x2c))(piVar3,"firsthalf");
    (**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar3);
  }
  iVar4 = CGlobalEntityList::FindEntityByClassname
                    ((CGlobalEntityList *)gEntList,(CBaseEntity *)0x0,"info_director");
  if (iVar4 != 0) {
    this_01 = (CInfoDirector *)
              __dynamic_cast(iVar4,&CBaseEntity::typeinfo,&CInfoDirector::typeinfo,0);
    if (this_01 != (CInfoDirector *)0x0) {
      CInfoDirector::OnScavengeRoundStart(this_01);
    }
  }
  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}

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)