L L4D2node

CNavArea::ComputeNormal

0x006fc000 · 163 bytes · __thiscall

_ZNK8CNavArea13ComputeNormalEP6Vectorb

Decompiled

undefined (3 params)

/* CNavArea::ComputeNormal(Vector*, bool) const */

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

{
  float fVar1;
  float fVar2;
  float fVar3;
  float fVar4;
  
  if (param_1 != (Vector *)0x0) {
    if (param_2) {
      fVar4 = *(float *)(this + 0x28) - *(float *)(this + 0x18);
      fVar2 = *(float *)(this + 4) - *(float *)(this + 0x10);
      fVar1 = *(float *)(this + 8) - *(float *)(this + 0x14);
      fVar3 = *(float *)(this + 0x24) - *(float *)(this + 0x18);
    }
    else {
      fVar4 = *(float *)(this + 0x24) - *(float *)(this + 0xc);
      fVar2 = *(float *)(this + 0x10) - *(float *)(this + 4);
      fVar1 = *(float *)(this + 0x14) - *(float *)(this + 8);
      fVar3 = *(float *)(this + 0x28) - *(float *)(this + 0xc);
    }
    *(float *)param_1 = -(fVar4 * fVar1);
    *(float *)(param_1 + 4) = -(fVar3 * fVar2);
    *(float *)(param_1 + 8) = fVar1 * fVar2;
    VectorNormalize(param_1);
  }
  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)