UTIL_WaterLevel
0x00b2d180 · 313 bytes · __cdecl
_Z15UTIL_WaterLevelRK6Vectorff
Decompiled
undefined (3 params)
/* UTIL_WaterLevel(Vector const&, float, float) */
longdouble UTIL_WaterLevel(Vector *param_1,float param_2,float param_3)
{
uint uVar1;
float fVar2;
float fVar3;
undefined4 local_18;
undefined4 local_14;
float local_10;
local_10 = param_2;
local_18 = *(undefined4 *)param_1;
local_14 = *(undefined4 *)(param_1 + 4);
uVar1 = (**(code **)*enginetrace)(enginetrace,&local_18,0x4030,0);
fVar2 = param_2;
if ((uVar1 & 0x4030) != 0) {
local_10 = param_3;
uVar1 = (**(code **)*enginetrace)(enginetrace,&local_18,0x4030,0);
fVar2 = param_3;
if ((uVar1 & 0x4030) == 0) {
fVar3 = param_3 - param_2;
fVar2 = local_10;
while (1.0 < fVar3) {
local_10 = param_2 + fVar3 * 0.5;
uVar1 = (**(code **)*enginetrace)(enginetrace,&local_18,0x4030,0);
fVar2 = local_10;
if ((uVar1 & 0x4030) == 0) {
param_3 = local_10;
fVar2 = param_2;
}
fVar3 = param_3 - fVar2;
param_2 = fVar2;
fVar2 = local_10;
}
}
}
return (longdouble)fVar2;
}
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.