L L4D2node

Script_GetFlowPercentForPosition

0x00b42750 · 176 bytes · __cdecl

_ZL32Script_GetFlowPercentForPosition6Vectorb

Decompiled

undefined (2 params)

/* Script_GetFlowPercentForPosition(Vector, bool) */

longdouble Script_GetFlowPercentForPosition(void)

{
  float fVar1;
  undefined4 uVar2;
  int iVar3;
  float fVar4;
  undefined4 in_stack_00000010;
  
  uVar2 = in_stack_00000010;
  iVar3 = CNavMesh::GetNearestNavArea
                    (TheNavMesh,(Vector *)&stack0x00000004,false,10000.0,false,true,false);
  fVar4 = 0.0;
  if (iVar3 != 0) {
    fVar4 = 0.0;
    fVar1 = *(float *)(TheNavMesh + 0x5f4);
    if ((char)uVar2 == '\0') {
      if (0.0 < fVar1) {
        return (longdouble)((*(float *)(iVar3 + 0x154) * 100.0) / fVar1);
      }
    }
    else if (0.0 < fVar1) {
      fVar4 = (*(float *)(iVar3 + 0x158) * 100.0) / fVar1;
    }
  }
  return (longdouble)fVar4;
}

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)