L L4D2node

SnapYawTo

0x0046c970 · 176 bytes · __cdecl

_Z9SnapYawTof

Decompiled

undefined (1 param)

/* SnapYawTo(float) */

longdouble SnapYawTo(float param_1)

{
  float fVar1;
  float fVar2;
  
  fVar1 = 0.0;
  fVar2 = 1.0;
  if (param_1 < 0.0) {
    fVar2 = -1.0;
    param_1 = -param_1;
  }
  if (23.0 <= param_1) {
    if (param_1 < 67.0) {
      return (longdouble)(fVar2 * 45.0);
    }
    if (param_1 < 113.0) {
      return (longdouble)(fVar2 * 90.0);
    }
    if (param_1 < 157.0) {
      fVar1 = fVar2 * 135.0;
    }
    else {
      fVar1 = fVar2 * 180.0;
    }
  }
  return (longdouble)fVar1;
}

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)