StayOnFloor
0x00726720 · 577 bytes · __cdecl
_Z11StayOnFloorP10CGameTracef
Decompiled
undefined (2 params)
/* StayOnFloor(CGameTrace*, float) */
bool StayOnFloor(CGameTrace *param_1,float param_2)
{
float fVar1;
float fVar2;
float fVar3;
undefined **local_70 [4];
undefined4 local_60;
float local_5c;
float local_58;
float local_54;
undefined4 local_4c;
undefined4 local_48;
float local_44;
float local_3c;
float local_38;
float local_34;
float local_2c;
float local_28;
float local_24;
undefined4 local_1c;
undefined1 local_18;
undefined1 local_17;
fVar1 = *(float *)(param_1 + 0x14);
fVar2 = *(float *)(param_1 + 0xc);
fVar3 = *(float *)(param_1 + 0x10);
CTraceFilterSimple::CTraceFilterSimple
((CTraceFilterSimple *)local_70,(IHandleEntity *)0x0,0,
(_func_bool_IHandleEntity_ptr_int *)0x0);
local_4c = 0;
local_48 = 0;
local_44 = (fVar1 - param_2) - fVar1;
local_70[0] = &PTR_ShouldHitEntity_00ca1b68;
local_60 = 0xf;
local_1c = 0;
local_17 = local_44 * local_44 != 0.0;
local_28 = (DAT_00fe6ba4 - DAT_00fe6bb0) * 0.5;
local_24 = (DAT_00fe6ba8 - DAT_00fe6bb4) * 0.5;
local_2c = (NavTraceMaxs - NavTraceMins) * 0.5;
local_3c = (NavTraceMaxs + NavTraceMins) * 0.5;
local_34 = (DAT_00fe6ba8 + DAT_00fe6bb4) * 0.5;
local_38 = (DAT_00fe6ba4 + DAT_00fe6bb0) * 0.5;
local_5c = fVar2 + local_3c;
local_54 = fVar1 + local_34;
local_58 = fVar3 + local_38;
local_18 = local_2c * local_2c + local_28 * local_28 + local_24 * local_24 < 1e-06;
local_3c = -local_3c;
local_38 = -local_38;
local_34 = -local_34;
(**(code **)(*enginetrace + 0x14))
(enginetrace,&local_5c,0x2420b,(CTraceFilterSimple *)local_70,param_1);
if (*(int *)(r_visualizetraces._28_4_ + 0x30) != 0) {
DebugDrawLine((Vector *)param_1,(Vector *)(param_1 + 0xc),0xff,0xff,0,true,-1.0);
}
if (param_1[0x37] == (CGameTrace)0x0) {
if (1.0 < *(float *)(param_1 + 0x2c) || *(float *)(param_1 + 0x2c) == 1.0) {
return false;
}
return *(float *)(nav_slope_limit._28_4_ + 0x2c) <= *(float *)(param_1 + 0x20);
}
return false;
}
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.