L L4D2node

GetRandomSpot

0x00af4380 · 257 bytes · unknown

_Z13GetRandomSpotv

Decompiled

undefined (0 params)

/* WARNING: Unknown calling convention -- yet parameter storage is locked */
/* GetRandomSpot() */

float * GetRandomSpot(void)

{
  undefined4 uVar1;
  int iVar2;
  longdouble lVar3;
  longdouble lVar4;
  longdouble lVar5;
  float *in_stack_00000004;
  undefined4 uVar6;
  undefined4 uVar7;
  undefined4 uVar8;
  
  iVar2 = GetWorldEntity();
  if (iVar2 != 0) {
    uVar6 = *(undefined4 *)(iVar2 + 0x448);
    uVar7 = *(undefined4 *)(iVar2 + 0x44c);
    uVar8 = *(undefined4 *)(iVar2 + 0x454);
    uVar1 = *(undefined4 *)(iVar2 + 0x458);
    lVar3 = (longdouble)
            RandomFloat(*(undefined4 *)(iVar2 + 0x450),*(undefined4 *)(iVar2 + 0x45c),uVar6,uVar7,
                        uVar8);
    lVar4 = (longdouble)RandomFloat(uVar7,uVar1);
    lVar5 = (longdouble)RandomFloat(uVar6,uVar8);
    in_stack_00000004[1] = (float)lVar4;
    in_stack_00000004[2] = (float)lVar3;
    *in_stack_00000004 = (float)lVar5;
    return in_stack_00000004;
  }
  *in_stack_00000004 = 0.0;
  in_stack_00000004[1] = 0.0;
  in_stack_00000004[2] = 0.0;
  return in_stack_00000004;
}

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)