L L4D2node

CalcDistanceToLineSegment2D

0x000a7e20 · 105 bytes · __cdecl

_Z27CalcDistanceToLineSegment2DRK8Vector2DS1_S1_Pf

Decompiled

undefined (4 params)

/* CalcDistanceToLineSegment2D(Vector2D const&, Vector2D const&, Vector2D const&, float*) */

longdouble
CalcDistanceToLineSegment2D(Vector2D *param_1,Vector2D *param_2,Vector2D *param_3,float *param_4)

{
  float local_14;
  float local_10;
  
  CalcClosestPointOnLineSegment2D(param_1,param_2,param_3,(Vector2D *)&local_14,param_4);
  return (longdouble)
         SQRT((*(float *)param_1 - local_14) * (*(float *)param_1 - local_14) +
              (*(float *)(param_1 + 4) - local_10) * (*(float *)(param_1 + 4) - local_10));
}

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)