L L4D2node

CNavArea::GetClosestPointOnArea

0x006fc600 · 239 bytes · __thiscall

_ZNK8CNavArea21GetClosestPointOnAreaEPK6VectorPS0_

Decompiled

undefined (3 params)

/* CNavArea::GetClosestPointOnArea(Vector const*, Vector*) const */

void __thiscall CNavArea::GetClosestPointOnArea(CNavArea *this,Vector *param_1,Vector *param_2)

{
  float fVar1;
  longdouble lVar2;
  uint uVar3;
  float fVar4;
  
  uVar3 = -(uint)(0.0 <= *(float *)param_1 - *(float *)(this + 4));
  fVar1 = (float)(~uVar3 & (uint)*(float *)(this + 4) | (uint)*(float *)param_1 & uVar3);
  uVar3 = -(uint)(0.0 <= fVar1 - *(float *)(this + 0x10));
  fVar4 = (float)(~uVar3 & (uint)fVar1 | (uint)*(float *)(this + 0x10) & uVar3);
  uVar3 = -(uint)(0.0 <= *(float *)(param_1 + 4) - *(float *)(this + 8));
  fVar1 = (float)(~uVar3 & (uint)*(float *)(this + 8) | (uint)*(float *)(param_1 + 4) & uVar3);
  uVar3 = -(uint)(fVar1 - *(float *)(this + 0x14) < 0.0);
  fVar1 = (float)(~uVar3 & (uint)*(float *)(this + 0x14) | (uint)fVar1 & uVar3);
  lVar2 = (longdouble)GetZ(this,fVar4,fVar1);
  *(float *)param_2 = fVar4;
  *(float *)(param_2 + 4) = fVar1;
  *(float *)(param_2 + 8) = (float)lVar2;
  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)