L L4D2node

UTIL_VecToPitch

0x0057f9c0 · 179 bytes · __cdecl

_Z15UTIL_VecToPitchRK11matrix3x4_tRK6Vector

Decompiled

undefined (2 params)

/* UTIL_VecToPitch(matrix3x4_t const&, Vector const&) */

longdouble UTIL_VecToPitch(matrix3x4_t *param_1,Vector *param_2)

{
  longdouble lVar1;
  float fVar2;
  float local_18;
  float local_14;
  float local_10;
  
  local_18 = *(float *)param_2;
  local_14 = *(float *)(param_2 + 4);
  local_10 = *(float *)(param_2 + 8);
  lVar1 = (longdouble)VectorNormalize((Vector *)&local_18);
  if (0.0 < (float)lVar1) {
    lVar1 = (longdouble)
            __asinf_finite(-(*(float *)(param_1 + 0x18) * local_14 +
                             *(float *)(param_1 + 8) * local_18 +
                            *(float *)(param_1 + 0x28) * local_10));
    fVar2 = (float)lVar1 * 57.295776;
    if (fVar2 < 0.0) {
      fVar2 = fVar2 + 360.0;
    }
    return (longdouble)fVar2;
  }
  return (longdouble)0.0;
}

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)