L L4D2node

CDirector::OnBeginTransition

0x008825a0 · 821 bytes · __thiscall

_ZN9CDirector17OnBeginTransitionEb

Decompiled

undefined (2 params)

/* CDirector::OnBeginTransition(bool) */

void __thiscall CDirector::OnBeginTransition(CDirector *this,bool param_1)

{
  float fVar1;
  uint uVar2;
  char cVar3;
  int iVar4;
  undefined4 uVar5;
  undefined *puVar6;
  longdouble lVar7;
  float fVar8;
  undefined4 local_40;
  undefined4 local_3c;
  undefined4 local_38;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  
  m_isTransitioning = 1;
  m_isScenarioRestart = !param_1;
  if (*(float *)(this + 0x3ac) <= 0.0) {
    fVar8 = 99999.9;
  }
  else {
    lVar7 = (longdouble)IntervalTimer::Now();
    fVar8 = (float)lVar7 - *(float *)(this + 0x3ac);
  }
  *(float *)(this + 0x3b0) = fVar8 + *(float *)(this + 0x3b0);
  lVar7 = (longdouble)IntervalTimer::Now();
  if ((float)lVar7 != *(float *)(this + 0x3ac)) {
    (**(code **)(*(int *)(this + 0x3a8) + 4))(this + 0x3a8,this + 0x3ac);
    *(float *)(this + 0x3ac) = (float)lVar7;
  }
  local_30 = 0;
  local_2c = 0;
  local_28 = 0;
  local_24 = 0;
  local_20 = 0;
  local_40 = 0xffffffff;
  local_3c = 7;
  local_38 = 1;
  local_34 = 9;
                    /* try { // try from 0088267f to 008828d5 has its CatchHandler @ 008828f8 */
  ForEachPlayer<PlayerCollector>((PlayerCollector *)&local_40);
  ConVar::SetValue(0xffcce0);
  if (param_1) {
    cVar3 = IsFirstMapInScenario();
    if (cVar3 != '\0') {
      lVar7 = (longdouble)
              RandomFloat(*(float *)(DirectorTankMinInterval._28_4_ + 0x2c) * 0.25,
                          *(undefined4 *)(DirectorTankMaxInterval._28_4_ + 0x2c));
      fVar8 = (float)lVar7;
      lVar7 = (longdouble)CountdownTimer::Now();
      if ((float)lVar7 + fVar8 != *(float *)(this + 0x174)) {
        (**(code **)(*(int *)(this + 0x16c) + 4))(this + 0x16c,this + 0x174);
        *(float *)(this + 0x174) = (float)lVar7 + fVar8;
      }
      if (fVar8 != *(float *)(this + 0x170)) {
        (**(code **)(*(int *)(this + 0x16c) + 4))(this + 0x16c,this + 0x170);
        *(float *)(this + 0x170) = fVar8;
      }
    }
    fVar8 = *(float *)(this + 0x29c);
    lVar7 = (longdouble)CountdownTimer::Now();
    fVar1 = *(float *)(this + 0x174);
    *(float *)(this + 0x38c) = fVar8 - (float)lVar7;
    lVar7 = (longdouble)CountdownTimer::Now();
    *(undefined4 *)(this + 0x394) = 0;
    *(float *)(this + 0x390) = fVar1 - (float)lVar7;
    if (((((*(int *)(this + 0x40c) != 0) && (uVar2 = **(uint **)(this + 0x400), uVar2 != 0xffffffff)
          ) && (puVar6 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc))
        && ((*(uint *)(puVar6 + 8) == uVar2 >> 0xc &&
            (*(CBaseEntity **)(puVar6 + 4) != (CBaseEntity *)0x0)))) &&
       (iVar4 = CBaseEntity::GetTeamNumber(*(CBaseEntity **)(puVar6 + 4)), iVar4 == 3)) {
      iVar4 = 0;
      uVar2 = **(uint **)(this + 0x400);
      if (((uVar2 != 0xffffffff) &&
          (puVar6 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar6 + 8) == uVar2 >> 0xc)) {
        iVar4 = *(int *)(puVar6 + 4);
      }
      uVar5 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(iVar4 + 0x30));
      *(undefined4 *)(this + 0x394) = uVar5;
    }
  }
  (**(code **)**(undefined4 **)(this + 0x630))(*(undefined4 **)(this + 0x630),param_1);
  local_24 = 0;
  CUtlMemory<CTerrorPlayer*,int>::Purge((CUtlMemory<CTerrorPlayer*,int> *)&local_30);
  local_20 = local_30;
  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)