UTIL_FindClosestPassableSpace
0x00582cc0 · 509 bytes · __cdecl
_Z29UTIL_FindClosestPassableSpaceP11CBaseEntityRK6VectorjjRS1_PS1_
Decompiled
undefined (6 params)
/* UTIL_FindClosestPassableSpace(CBaseEntity*, Vector const&, unsigned int, unsigned int, Vector&,
Vector*) */
undefined4
UTIL_FindClosestPassableSpace
(CBaseEntity *param_1,Vector *param_2,uint param_3,uint param_4,Vector *param_5,
Vector *param_6)
{
uint uVar1;
undefined4 uVar2;
undefined *puVar3;
float local_4c;
float local_48;
float local_44;
float local_40;
float local_3c;
float local_38;
float local_34;
float local_30;
float local_2c;
Vector local_28 [12];
undefined **local_1c;
CBaseEntity *local_18;
undefined4 local_14;
undefined4 local_10;
uVar1 = *(uint *)(param_1 + 0x188);
if ((((uVar1 == 0xffffffff) ||
(puVar3 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar3 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar3 + 8) != uVar1 >> 0xc)) || (*(int *)(puVar3 + 4) == 0)) {
CCollisionProperty::CollisionAABBToWorldAABB
((CCollisionProperty *)(param_1 + 0x194),(Vector *)(param_1 + 0x19c),
(Vector *)(param_1 + 0x1a8),(Vector *)&local_40,(Vector *)&local_4c);
local_30 = (local_3c + local_48) * 0.5;
local_34 = (local_40 + local_4c) * 0.5;
local_2c = (local_38 + local_44) * 0.5;
local_48 = local_48 - local_30;
local_4c = local_4c - local_34;
local_44 = local_44 - local_2c;
if (((byte)param_1[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(param_1);
}
if (param_6 != (Vector *)0x0) {
if (((byte)param_1[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(param_1);
}
local_30 = (*(float *)(param_6 + 4) + local_30) - *(float *)(param_1 + 0x2e4);
local_2c = (*(float *)(param_6 + 8) + local_2c) - *(float *)(param_1 + 0x2e8);
local_34 = (local_34 + *(float *)param_6) - *(float *)(param_1 + 0x2e0);
}
local_14 = *(undefined4 *)(param_1 + 0x234);
local_1c = &PTR_ShouldHitEntity_00c54528;
local_18 = param_1;
local_10 = 0;
uVar2 = UTIL_FindClosestPassableSpace
((Vector *)&local_34,(Vector *)&local_4c,param_2,(ITraceFilter *)&local_1c,
param_3,param_4,local_28);
}
else {
if (((byte)param_1[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(param_1);
}
uVar2 = 0;
*(undefined4 *)param_5 = *(undefined4 *)(param_1 + 0x2e0);
*(undefined4 *)(param_5 + 4) = *(undefined4 *)(param_1 + 0x2e4);
*(undefined4 *)(param_5 + 8) = *(undefined4 *)(param_1 + 0x2e8);
}
return uVar2;
}
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.