L L4D2node

IntersectRayWithPlane

0x0058a6b0 · 114 bytes · __cdecl

_Z21IntersectRayWithPlaneRK5Ray_tRK8cplane_t

Decompiled

undefined (2 params)

/* IntersectRayWithPlane(Ray_t const&, cplane_t const&) */

longdouble IntersectRayWithPlane(Ray_t *param_1,cplane_t *param_2)

{
  float fVar1;
  float fVar2;
  
  fVar2 = *(float *)(param_1 + 0x14) * *(float *)(param_2 + 4) +
          *(float *)(param_1 + 0x10) * *(float *)param_2 +
          *(float *)(param_1 + 0x18) * *(float *)(param_2 + 8);
  fVar1 = 0.0;
  if (fVar2 != 0.0) {
    fVar1 = ((*(float *)(param_2 + 0xc) -
             (*(float *)(param_2 + 8) * *(float *)(param_1 + 8) +
             *(float *)param_2 * *(float *)param_1)) -
            *(float *)(param_2 + 4) * *(float *)(param_1 + 4)) / fVar2;
  }
  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)