L L4D2node

CalcForwardViewOffset

0x004f4040 · 189 bytes · __cdecl

_Z21CalcForwardViewOffsetRK6QAngleb

Decompiled

undefined (2 params)

/* CalcForwardViewOffset(QAngle const&, bool) */

longdouble CalcForwardViewOffset(QAngle *param_1,bool param_2)

{
  float fVar1;
  float fVar2;
  float fVar3;
  
  fVar1 = *(float *)param_1;
  if (180.0 < fVar1) {
    fVar1 = fVar1 - 360.0;
  }
  fVar2 = *(float *)(ViewOffsetForward._28_4_ + 0x2c);
  fVar3 = *(float *)(ViewOffsetUp._28_4_ + 0x2c);
  if (param_2) {
    fVar3 = -32.0;
  }
  if (fVar1 <= 0.0) {
    if (fVar1 < 0.0) {
      return (longdouble)(fVar3 * -fVar1 * 0.011111111 + (1.0 - -fVar1 * 0.011111111) * fVar2);
    }
  }
  else {
    fVar2 = fVar2 * (1.0 - fVar1 * 0.011111111) +
            fVar1 * 0.011111111 * *(float *)(ViewOffsetDown._28_4_ + 0x2c);
  }
  return (longdouble)fVar2;
}

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)