CSceneFindMarkFilter::ShouldFindEntity
0x0081aa70 · 956 bytes · __thiscall
_ZN20CSceneFindMarkFilter16ShouldFindEntityEP11CBaseEntity
Decompiled
undefined (2 params)
/* CSceneFindMarkFilter::ShouldFindEntity(CBaseEntity*) */
undefined4 __thiscall
CSceneFindMarkFilter::ShouldFindEntity(CSceneFindMarkFilter *this,CBaseEntity *param_1)
{
float fVar1;
float fVar2;
float fVar3;
uint uVar4;
undefined4 uVar5;
undefined4 *puVar6;
float *pfVar7;
float *pfVar8;
undefined *puVar9;
int iVar10;
IHandleEntity *local_ec;
CTraceFilterSimple local_dc [16];
float local_cc;
float local_c8;
float local_c4;
undefined4 local_bc;
undefined4 local_b8;
undefined4 local_b4;
float local_ac;
float local_a8;
float local_a4;
float local_9c;
float local_98;
float local_94;
undefined4 local_8c;
undefined1 local_88;
undefined1 local_87;
Vector local_70 [12];
Vector local_64 [43];
char local_39;
uVar4 = *(uint *)(this + 4);
if ((((uVar4 == 0xffffffff) ||
(puVar9 = g_pEntityList + (uVar4 & 0xfff) * 0x10, puVar9 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar9 + 8) != uVar4 >> 0xc)) || (*(int *)(puVar9 + 4) == 0)) {
uVar5 = 1;
}
else {
uVar4 = *(uint *)(this + 8);
if (((uVar4 == 0xffffffff) ||
(puVar9 = g_pEntityList + (uVar4 & 0xfff) * 0x10, puVar9 == (undefined *)0xfffffffc)) ||
((*(uint *)(puVar9 + 8) != uVar4 >> 0xc || (*(int *)(puVar9 + 4) == 0)))) {
if (param_1 == (CBaseEntity *)0x0) {
*(undefined4 *)(this + 8) = 0xffffffff;
}
else {
puVar6 = (undefined4 *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
*(undefined4 *)(this + 8) = *puVar6;
}
}
if (((byte)param_1[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(param_1);
}
fVar1 = *(float *)(param_1 + 0x2e0);
fVar2 = *(float *)(param_1 + 0x2e4);
fVar3 = *(float *)(param_1 + 0x2e8);
uVar4 = *(uint *)(this + 4);
if (((uVar4 == 0xffffffff) ||
(puVar9 = g_pEntityList + (uVar4 & 0xfff) * 0x10, puVar9 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar9 + 8) != uVar4 >> 0xc)) {
local_ec = (IHandleEntity *)0x0;
}
else {
local_ec = *(IHandleEntity **)(puVar9 + 4);
}
pfVar7 = (float *)(**(code **)(*(int *)(local_ec + 0x194) + 8))(local_ec + 0x194);
iVar10 = 0;
uVar4 = *(uint *)(this + 4);
if (((uVar4 != 0xffffffff) &&
(puVar9 = g_pEntityList + (uVar4 & 0xfff) * 0x10, puVar9 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar9 + 8) == uVar4 >> 0xc)) {
iVar10 = *(int *)(puVar9 + 4);
}
pfVar8 = (float *)(**(code **)(*(int *)(iVar10 + 0x194) + 4))(iVar10 + 0x194);
local_87 = 0;
local_bc = 0;
local_b8 = 0;
local_b4 = 0;
local_8c = 0;
local_9c = (*pfVar7 - *pfVar8) * 0.5;
local_98 = (pfVar7[1] - pfVar8[1]) * 0.5;
local_94 = (pfVar7[2] - pfVar8[2]) * 0.5;
local_88 = local_98 * local_98 + local_9c * local_9c + local_94 * local_94 < 1e-06;
local_ac = (*pfVar7 + *pfVar8) * 0.5;
local_a8 = (pfVar7[1] + pfVar8[1]) * 0.5;
local_a4 = (pfVar7[2] + pfVar8[2]) * 0.5;
local_cc = fVar1 + local_ac;
local_c8 = fVar2 + local_a8;
local_c4 = fVar3 + local_a4;
local_ac = -local_ac;
local_a8 = -local_a8;
local_a4 = -local_a4;
CTraceFilterSimple::CTraceFilterSimple
(local_dc,local_ec,0,(_func_bool_IHandleEntity_ptr_int *)0x0);
(**(code **)(*enginetrace + 0x14))(enginetrace,&local_cc,0x200400b,local_dc,local_70);
if (*(int *)(r_visualizetraces._28_4_ + 0x30) != 0) {
DebugDrawLine(local_70,local_64,0xff,0xff,0,true,-1.0);
}
uVar5 = 0;
if (local_39 == '\0') {
puVar6 = (undefined4 *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
*(undefined4 *)(this + 8) = *puVar6;
return 1;
}
}
return uVar5;
}
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.