L L4D2node

CGameTimescale::UpdateTimescale

0x004659f0 · 297 bytes · __thiscall

_ZN14CGameTimescale15UpdateTimescaleEv

Decompiled

undefined (1 param)

/* CGameTimescale::UpdateTimescale() */

void __thiscall CGameTimescale::UpdateTimescale(CGameTimescale *this)

{
  float fVar1;
  float fVar2;
  float *pfVar3;
  int *piVar4;
  char cVar5;
  longdouble lVar6;
  float fVar7;
  float fVar8;
  float fVar9;
  
  cVar5 = (**(code **)(*engine + 0x148))(engine);
  pfVar3 = gpGlobals;
  if (cVar5 == '\0') {
    fVar9 = *(float *)(this + 0x10);
    fVar8 = *(float *)(this + 0xc);
    if ((fVar9 == fVar8) || (fVar1 = *(float *)(this + 0x24), fVar1 == 0.0)) {
      *(undefined4 *)(this + 0x14) = *(undefined4 *)(this + 0x1c);
      *(float *)(this + 0x24) = *pfVar3;
      return;
    }
    fVar2 = *gpGlobals;
    *(float *)(this + 0x24) = fVar2;
    fVar7 = ABS(fVar8 - fVar9);
    if (ABS(fVar8 - fVar9) <= *(float *)(this + 0x1c)) {
      fVar7 = *(float *)(this + 0x1c);
    }
    fVar7 = fVar7 * *(float *)(this + 0x20);
    if (*(float *)(this + 0x14) <= fVar7) {
      lVar6 = (longdouble)Approach(fVar7,*(float *)(this + 0x14),*(float *)(this + 0x18));
      fVar9 = *(float *)(this + 0x10);
      fVar7 = (float)lVar6;
      fVar8 = *(float *)(this + 0xc);
      *(float *)(this + 0x14) = fVar7;
    }
    else {
      *(float *)(this + 0x14) = fVar7;
    }
    lVar6 = (longdouble)Approach(fVar8,fVar9,fVar7 * (fVar2 - fVar1));
    piVar4 = engine;
    *(float *)(this + 0x10) = (float)lVar6;
    (**(code **)(*piVar4 + 0x200))(piVar4,(float)lVar6);
  }
  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)