L L4D2node

CEnvWindShared::WindThink

0x0044bc30 · 672 bytes · __thiscall

_ZN14CEnvWindShared9WindThinkEf

Decompiled

undefined (2 params)

/* CEnvWindShared::WindThink(float) */

longdouble __thiscall CEnvWindShared::WindThink(CEnvWindShared *this,float param_1)

{
  CEnvWindShared *pCVar1;
  float fVar2;
  int iVar3;
  int iVar4;
  longdouble lVar5;
  float fVar6;
  float fVar7;
  float fVar8;
  float fVar9;
  float fVar10;
  undefined4 local_28;
  float local_24;
  undefined4 local_20;
  
  ComputeWindVariation(this,param_1);
  fVar8 = *(float *)(this + 0xb0);
  while( true ) {
    fVar9 = fVar8 - *(float *)(this + 0xac);
    fVar7 = *(float *)(this + 0x44);
    fVar10 = param_1 - *(float *)(this + 0xac);
    fVar6 = fVar10;
    if (fVar9 <= fVar10) {
      fVar6 = fVar9;
    }
    fVar2 = *(float *)(this + 0xb4);
    if (fVar2 <= fVar7) {
      if (fVar2 < fVar7) {
        fVar7 = fVar7 - fVar6 * 15.0;
        if (fVar7 <= fVar2) {
          fVar7 = fVar2;
        }
        *(float *)(this + 0x44) = fVar7;
      }
    }
    else {
      fVar7 = fVar6 * 150.0 + fVar7;
      if (fVar2 <= fVar7) {
        fVar7 = fVar2;
      }
      *(float *)(this + 0x44) = fVar7;
    }
    if (fVar10 <= fVar9) break;
    *(float *)(this + 0xac) = fVar8;
    pCVar1 = this + 200;
    if (this[0xb8] == (CEnvWindShared)0x0) {
      iVar4 = CUniformRandomStream::RandomInt((int)pCVar1,*(int *)(this + 0x18));
      iVar3 = *(int *)(this + 0x40);
      *(float *)(this + 0xb4) = (float)iVar4;
      iVar4 = CUniformRandomStream::RandomInt((int)pCVar1,-*(int *)(this + 0x2c));
      this[0xb8] = (CEnvWindShared)0x1;
      *(int *)(this + 0x40) =
           (int)((float)((int)((float)(iVar3 + iVar4) * 182.04445) & 0xffff) * 0.005493164);
      COutputEvent::FireOutput
                ((COutputEvent *)(this + 0x74),(CBaseEntity *)0x0,(CBaseEntity *)0x0,0.0);
      fVar8 = *(float *)(this + 0x28) + *(float *)(this + 0xb0);
      *(float *)(this + 0xb0) = fVar8;
    }
    else {
      iVar3 = CUniformRandomStream::RandomInt((int)pCVar1,*(int *)(this + 0xc));
      this[0xb8] = (CEnvWindShared)0x0;
      *(float *)(this + 0xb4) = (float)iVar3;
      fVar8 = *(float *)(this + 0x20);
      lVar5 = (longdouble)CUniformRandomStream::RandomFloat((float)pCVar1,0.0);
      *(float *)(this + 0xb0) = fVar8 + *(float *)(this + 0xb0) + (float)lVar5;
      COutputEvent::FireOutput
                ((COutputEvent *)(this + 0x8c),(CBaseEntity *)0x0,(CBaseEntity *)0x0,0.0);
      fVar8 = *(float *)(this + 0xb0);
    }
  }
  local_28 = 0;
  local_20 = 0;
  *(float *)(this + 0xac) = param_1;
  local_24 = (float)*(int *)(this + 0x40) + *(float *)(this + 0xbc);
  AngleVectors((QAngle *)&local_28,(Vector *)(this + 0x48));
  fVar8 = *(float *)(this + 0xc0) * *(float *)(this + 0x44);
  *(float *)(this + 0x48) = *(float *)(this + 0x48) * fVar8;
  *(float *)(this + 0x4c) = *(float *)(this + 0x4c) * fVar8;
  *(float *)(this + 0x50) = fVar8 * *(float *)(this + 0x50);
  return (longdouble)(param_1 + 0.01);
}

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)