CNavMesh::SnapToGrid
0x00709e70 · 156 bytes · __thiscall
_ZNK8CNavMesh10SnapToGridEfb
Decompiled
undefined (3 params)
/* CNavMesh::SnapToGrid(float, bool) const */
longdouble __thiscall CNavMesh::SnapToGrid(CNavMesh *this,float param_1,bool param_2)
{
float fVar1;
int iVar2;
int iVar3;
float fVar4;
if (*(int *)(TheNavMesh + 0x528) == 0) {
iVar2 = GetGridSize(param_2);
fVar4 = (float)iVar2;
iVar3 = (int)fVar4;
if (iVar2 == 0) {
return (longdouble)param_1;
}
}
else {
fVar4 = 25.0;
iVar3 = 0x19;
}
fVar1 = fVar4;
if (param_1 < 0.0) {
fVar1 = -fVar4;
}
return (longdouble)((float)((int)(param_1 + fVar1 * 0.5) / iVar3) * fVar4);
}
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.