L L4D2node

UTIL_SnapDirectionToAxis

0x00b2cb20 · 161 bytes · __cdecl

_Z24UTIL_SnapDirectionToAxisR6Vectorf

Decompiled

undefined (2 params)

/* UTIL_SnapDirectionToAxis(Vector&, float) */

void UTIL_SnapDirectionToAxis(Vector *param_1,float param_2)

{
  Vector *pVVar1;
  int iVar2;
  uint uVar3;
  
  iVar2 = 0;
  pVVar1 = param_1;
  do {
    if (1.0 - param_2 < ABS(*(float *)pVVar1)) {
      uVar3 = -(uint)(*(float *)pVVar1 < 0.0);
      *(uint *)pVVar1 = ~uVar3 & 0x3f800000 | uVar3 & 0xbf800000;
      *(undefined4 *)(param_1 + ((iVar2 + 1) % 3) * 4) = 0;
      *(undefined4 *)(param_1 + ((iVar2 + 2) % 3) * 4) = 0;
      return;
    }
    iVar2 = iVar2 + 1;
    pVVar1 = pVVar1 + 4;
  } while (iVar2 != 3);
  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)