TerrorNavArea::FindRandomSpot
0x009732f0 · 312 bytes · __cdecl
_ZNK13TerrorNavArea14FindRandomSpotEv
Decompiled
undefined (0 params)
/* TerrorNavArea::FindRandomSpot() const */
void TerrorNavArea::FindRandomSpot(void)
{
float fVar1;
longdouble lVar2;
float fVar3;
float fVar4;
float fVar5;
float *in_stack_00000004;
CNavArea *in_stack_00000008;
fVar4 = *(float *)(in_stack_00000008 + 4);
fVar3 = *(float *)(in_stack_00000008 + 0x10) - fVar4;
if ((50.0 <= fVar3) &&
(50.0 <= *(float *)(in_stack_00000008 + 0x14) - *(float *)(in_stack_00000008 + 8))) {
lVar2 = (longdouble)RandomFloat(0,fVar3 - 50.0);
fVar3 = *(float *)(in_stack_00000008 + 8);
fVar1 = *(float *)(in_stack_00000008 + 0x14);
fVar5 = fVar4 + 25.0 + (float)lVar2;
*in_stack_00000004 = fVar5;
lVar2 = (longdouble)RandomFloat(0,(fVar1 - fVar3) - 50.0);
fVar4 = fVar3 + 25.0 + (float)lVar2;
in_stack_00000004[1] = fVar4;
lVar2 = (longdouble)CNavArea::GetZ(in_stack_00000008,fVar5,fVar4);
in_stack_00000004[2] = (float)lVar2 + 10.0;
return;
}
*in_stack_00000004 = *(float *)(in_stack_00000008 + 0x2c);
in_stack_00000004[1] = *(float *)(in_stack_00000008 + 0x30);
in_stack_00000004[2] = *(float *)(in_stack_00000008 + 0x34) + 10.0;
return;
}
SourceMod gamedata
paste intoaddons/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.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.