L L4D2node

CDirector::GetTimeUntilNextGhostWave

0x008756a0 · 612 bytes · __thiscall

_ZN9CDirector25GetTimeUntilNextGhostWaveEf

Decompiled

undefined (2 params)

/* CDirector::GetTimeUntilNextGhostWave(float) */

longdouble __thiscall CDirector::GetTimeUntilNextGhostWave(CDirector *this,float param_1)

{
  int iVar1;
  int iVar2;
  longdouble lVar3;
  float fVar4;
  
  if (this[0x160] != (CDirector)0x0) {
    iVar1 = -1;
    if (0.0 < *(float *)(this + 0x1d8)) {
      lVar3 = (longdouble)CountdownTimer::Now();
      fVar4 = *(float *)(this + 0x1d8);
      if ((fVar4 <= (float)lVar3) &&
         ((iVar1 = ZombieGhostFinaleSpawnInterval._28_4_, **(int **)(this + 0x638) != 5 ||
          (iVar1 = ZombieGhostSpawnInterval._28_4_, *(int *)(this + 0x1c0) == 0)))) {
        fVar4 = *(float *)(iVar1 + 0x2c);
        lVar3 = (longdouble)CountdownTimer::Now();
        if ((float)lVar3 + fVar4 != *(float *)(this + 0x1d8)) {
          (**(code **)(*(int *)(this + 0x1d0) + 4))(this + 0x1d0,this + 0x1d8);
          *(float *)(this + 0x1d8) = (float)lVar3 + fVar4;
        }
        if (fVar4 != *(float *)(this + 0x1d4)) {
          (**(code **)(*(int *)(this + 0x1d0) + 4))(this + 0x1d0,this + 0x1d4);
          *(float *)(this + 0x1d4) = fVar4;
        }
        fVar4 = *(float *)(this + 0x1d8);
      }
      lVar3 = (longdouble)CountdownTimer::Now();
      iVar1 = 1;
      if (1.0 <= fVar4 - (float)lVar3) {
        fVar4 = *(float *)(this + 0x1d8);
        lVar3 = (longdouble)CountdownTimer::Now();
        iVar1 = (int)(fVar4 - (float)lVar3);
      }
    }
    if (((*(int *)(ZombieGhostGroupSpawn._28_4_ + 0x30) == 0) || (param_1 <= 0.0)) ||
       (iVar2 = *(int *)(ZombieGhostSpawnInterval._28_4_ + 0x30) - (int)param_1, iVar1 <= iVar2)) {
      fVar4 = (float)iVar1;
    }
    else {
      fVar4 = (float)iVar2;
      lVar3 = (longdouble)CountdownTimer::Now();
      if ((float)lVar3 + fVar4 != *(float *)(this + 0x1d8)) {
        (**(code **)(*(int *)(this + 0x1d0) + 4))(this + 0x1d0,this + 0x1d8);
        *(float *)(this + 0x1d8) = (float)lVar3 + fVar4;
      }
      if (fVar4 != *(float *)(this + 0x1d4)) {
        (**(code **)(*(int *)(this + 0x1d0) + 4))(this + 0x1d0,this + 0x1d4);
        *(float *)(this + 0x1d4) = fVar4;
      }
    }
    return (longdouble)fVar4;
  }
  return (longdouble)*(float *)(DirectorSpecialSpawnDelay._28_4_ + 0x2c);
}

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)