L L4D2node

CEnvShake::Think

0x00689880 · 529 bytes · __thiscall

_ZN9CEnvShake5ThinkEv

Decompiled

undefined (1 param)

/* CEnvShake::Think() */

void __thiscall CEnvShake::Think(CEnvShake *this)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  longdouble lVar4;
  float fVar5;
  float fVar6;
  double dVar7;
  
  piVar2 = random_valve;
  fVar5 = *(float *)(gpGlobals + 0xc);
  if (*(float *)(this + 0x454) <= fVar5 && fVar5 != *(float *)(this + 0x454)) {
    *(float *)(this + 0x454) = 1.0 / *(float *)(this + 0x444) + fVar5;
    lVar4 = (longdouble)(**(code **)(*piVar2 + 4))(piVar2,0xbf800000,0x3f800000);
    piVar2 = random_valve;
    *(float *)(this + 0x45c) = (float)lVar4;
    lVar4 = (longdouble)(**(code **)(*piVar2 + 4))(piVar2,0xbf800000,0x3f800000);
    *(undefined4 *)(this + 0x464) = 0x40800000;
    *(float *)(this + 0x460) = (float)lVar4;
    VectorNormalize((Vector *)(this + 0x45c));
    iVar3 = gpGlobals;
    fVar5 = *(float *)(this + 0x458) * 400.0;
    *(float *)(this + 0x45c) = *(float *)(this + 0x45c) * fVar5;
    *(float *)(this + 0x460) = *(float *)(this + 0x460) * fVar5;
    *(float *)(this + 0x464) = fVar5 * *(float *)(this + 0x464);
    fVar5 = *(float *)(iVar3 + 0xc);
  }
  fVar6 = (*(float *)(this + 0x450) - fVar5) / *(float *)(this + 0x448);
  if (0.0 <= fVar6) {
    if (fVar6 == 0.0) {
      fVar5 = 0.0;
    }
    else {
      dVar7 = sin((double)((*(float *)(this + 0x444) / fVar6) * fVar5));
      fVar5 = (float)(dVar7 * (double)(fVar6 * fVar6));
    }
    iVar3 = 0;
    do {
      *(float *)(this + iVar3 * 4 + 0x470) = *(float *)(this + iVar3 * 4 + 0x45c) * fVar5;
      iVar1 = gpGlobals;
      iVar3 = iVar3 + 1;
    } while (iVar3 != 3);
    *(float *)(this + 0x458) =
         *(float *)(this + 0x458) -
         (*(float *)(gpGlobals + 0x10) / (*(float *)(this + 0x444) * *(float *)(this + 0x448))) *
         *(float *)(this + 0x458);
    CBaseEntity::SetNextThink((CBaseEntity *)this,*(float *)(iVar1 + 0xc),(char *)0x0);
    return;
  }
                    /* WARNING: Could not recover jumptable at 0x00689a93. Too many branches */
                    /* WARNING: Treating indirect jump as call */
  (**(code **)(**(int **)(this + 0x468) + 0x1c))();
  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)