FindGroundZFromPoint
0x00701c70 · 469 bytes · __cdecl
_Z20FindGroundZFromPointRK6VectorS1_
Decompiled
undefined (2 params)
/* FindGroundZFromPoint(Vector const&, Vector const&) */
longdouble FindGroundZFromPoint(Vector *param_1,Vector *param_2)
{
char cVar1;
float fVar2;
float fVar3;
float local_38;
float local_34;
float local_2c;
float local_28;
float local_24;
float local_20;
fVar3 = *(float *)param_1;
fVar2 = *(float *)(param_1 + 4);
if (ABS(fVar3 - *(float *)param_2) <= ABS(fVar2 - *(float *)(param_2 + 4))) {
if (fVar2 < *(float *)(param_2 + 4)) {
local_34 = -25.0;
local_38 = 0.0;
}
else {
local_34 = 25.0;
local_38 = 0.0;
}
}
else {
local_34 = 0.0;
if (*(float *)param_2 <= fVar3) {
local_38 = 25.0;
}
else {
local_38 = -25.0;
}
}
local_28 = *(float *)param_2;
local_24 = *(float *)(param_2 + 4);
local_2c = *(float *)(param_2 + 8);
while (local_2c = local_2c + 18.0, local_20 = local_2c,
25.0 < SQRT((local_24 - fVar2) * (local_24 - fVar2) +
(local_28 - fVar3) * (local_28 - fVar3))) {
local_28 = local_28 + local_38;
local_24 = local_24 + local_34;
cVar1 = CNavMesh::GetGroundHeight(TheNavMesh,(Vector *)&local_28,&local_2c,(Vector *)0x0);
if (cVar1 == '\0') {
local_2c = local_20 - 18.0;
}
fVar3 = *(float *)param_1;
fVar2 = *(float *)(param_1 + 4);
}
local_28 = fVar3;
local_24 = fVar2;
cVar1 = CNavMesh::GetGroundHeight(TheNavMesh,(Vector *)&local_28,&local_2c,(Vector *)0x0);
if (cVar1 == '\0') {
local_2c = local_20 - 18.0;
}
return (longdouble)local_2c;
}
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.