L L4D2node

IntersectRayWithBox

0x000c68f0 · 301 bytes · __cdecl

_Z19IntersectRayWithBoxRK5Ray_tRK6VectorS4_fP10CBaseTracePf

Decompiled

undefined (6 params)

/* IntersectRayWithBox(Ray_t const&, Vector const&, Vector const&, float, CBaseTrace*, float*) */

void IntersectRayWithBox(Ray_t *param_1,Vector *param_2,Vector *param_3,float param_4,
                        CBaseTrace *param_5,float *param_6)

{
  float local_24;
  float local_20;
  float local_1c;
  float local_18;
  float local_14;
  float local_10;
  
  if (param_1[0x44] != (Ray_t)0x0) {
    IntersectRayWithBox((Vector *)param_1,(Vector *)(param_1 + 0x10),param_2,param_3,param_4,param_5
                        ,param_6);
    return;
  }
  local_24 = *(float *)param_2 - *(float *)(param_1 + 0x30);
  local_18 = *(float *)(param_1 + 0x30) + *(float *)param_3;
  local_20 = *(float *)(param_2 + 4) - *(float *)(param_1 + 0x34);
  local_14 = *(float *)(param_1 + 0x34) + *(float *)(param_3 + 4);
  local_1c = *(float *)(param_2 + 8) - *(float *)(param_1 + 0x38);
  local_10 = *(float *)(param_1 + 0x38) + *(float *)(param_3 + 8);
  IntersectRayWithBox((Vector *)param_1,(Vector *)(param_1 + 0x10),(Vector *)&local_24,
                      (Vector *)&local_18,param_4,param_5,param_6);
  *(float *)param_5 = *(float *)param_5 + *(float *)(param_1 + 0x20);
  *(float *)(param_5 + 4) = *(float *)(param_5 + 4) + *(float *)(param_1 + 0x24);
  *(float *)(param_5 + 8) = *(float *)(param_5 + 8) + *(float *)(param_1 + 0x28);
  *(float *)(param_5 + 0xc) = *(float *)(param_5 + 0xc) + *(float *)(param_1 + 0x20);
  *(float *)(param_5 + 0x10) = *(float *)(param_5 + 0x10) + *(float *)(param_1 + 0x24);
  *(float *)(param_5 + 0x14) = *(float *)(param_5 + 0x14) + *(float *)(param_1 + 0x28);
  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)