L L4D2node

RandomVectorInUnitCircle

0x0027b6b0 · 147 bytes · __cdecl

_Z24RandomVectorInUnitCircleP8Vector2D

Decompiled

undefined (1 param)

/* RandomVectorInUnitCircle(Vector2D*) */

longdouble RandomVectorInUnitCircle(Vector2D *param_1)

{
  longdouble lVar1;
  int iVar2;
  int iVar3;
  longdouble lVar4;
  float fVar5;
  
  iVar2 = rand();
  iVar3 = rand();
  fVar5 = SQRT((float)iVar2 * 3.051851e-05);
  lVar4 = (longdouble)((float)iVar3 * 3.051851e-05 * 6.2831855);
  lVar1 = (longdouble)fcos(lVar4);
  lVar4 = (longdouble)fsin(lVar4);
  *(float *)param_1 = (float)lVar1 * fVar5;
  *(float *)(param_1 + 4) = (float)lVar4 * fVar5;
  return (longdouble)fVar5;
}

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)