IsWalkableTraceLineClear
0x007286e0 · 1208 bytes · __cdecl
_Z24IsWalkableTraceLineClearRK6VectorS1_j
Decompiled
undefined (3 params)
/* IsWalkableTraceLineClear(Vector const&, Vector const&, unsigned int) */
bool IsWalkableTraceLineClear(Vector *param_1,Vector *param_2,uint param_3)
{
int iVar1;
CBaseEntity *this;
byte bVar2;
char cVar3;
byte bVar4;
float fVar5;
float fVar6;
float fVar7;
int local_f4;
undefined **local_e0 [4];
uint local_d0;
float local_cc;
float local_c8;
float local_c4;
float local_bc;
float local_b8;
float local_b4;
undefined4 local_ac;
undefined4 local_a8;
undefined4 local_a4;
undefined4 local_9c;
undefined4 local_98;
undefined4 local_94;
undefined4 local_8c;
undefined1 local_88;
undefined1 local_87;
Vector local_70 [12];
float local_64;
float local_60;
float local_5c;
float local_44;
CBaseEntity *local_24;
fVar7 = *(float *)param_1;
fVar6 = *(float *)(param_1 + 4);
fVar5 = *(float *)(param_1 + 8);
CTraceFilterSimple::CTraceFilterSimple
((CTraceFilterSimple *)local_e0,(IHandleEntity *)0x0,0,
(_func_bool_IHandleEntity_ptr_int *)0x0);
local_44 = 0.0;
local_e0[0] = &PTR_ShouldHitEntity_00ca1b68;
local_f4 = 0x32;
local_d0 = param_3;
bVar2 = (byte)(param_3 >> 2) & 1;
do {
local_94 = 0;
local_88 = 1;
local_bc = *(float *)param_2 - fVar7;
local_98 = 0;
local_b8 = *(float *)(param_2 + 4) - fVar6;
local_9c = 0;
local_b4 = *(float *)(param_2 + 8) - fVar5;
local_8c = 0;
local_a4 = 0;
local_a8 = 0;
local_ac = 0;
local_87 = local_b8 * local_b8 + local_bc * local_bc + local_b4 * local_b4 != 0.0;
local_cc = fVar7;
local_c8 = fVar6;
local_c4 = fVar5;
(**(code **)(*enginetrace + 0x14))(enginetrace,(Vector *)&local_cc,0x202420b,local_e0,local_70);
if (*(int *)(r_visualizetraces._28_4_ + 0x30) != 0) {
DebugDrawLine(local_70,(Vector *)&local_64,0xff,0,0,true,-1.0);
}
this = local_24;
if ((((local_44 == 1.0) || (*(char **)(local_24 + 0x7c) == "worldspawn")) ||
(cVar3 = CBaseEntity::ClassMatchesComplex(local_24,"worldspawn"), cVar3 != '\0')) ||
((*(char **)(this + 0x7c) == "player" ||
(cVar3 = CBaseEntity::ClassMatchesComplex(this,"player"), cVar3 != '\0')))) break;
if ((*(char **)(this + 0x7c) == "func_door*") ||
(cVar3 = CBaseEntity::ClassMatchesComplex(this,"func_door*"), cVar3 != '\0')) {
bVar4 = (byte)(param_3 >> 1) & 1;
joined_r0x00728a9a:
if (bVar4 == 0) break;
}
else {
if ((*(char **)(this + 0x7c) == "prop_door*") ||
(cVar3 = CBaseEntity::ClassMatchesComplex(this,"prop_door*"), cVar3 != '\0')) {
bVar4 = (byte)param_3 & 1;
goto joined_r0x00728a9a;
}
if ((*(char **)(this + 0x7c) == "func_brush") ||
(cVar3 = CBaseEntity::ClassMatchesComplex(this,"func_brush"), cVar3 != '\0')) {
iVar1 = *(int *)(this + 0x440);
if (iVar1 != 1) {
if (iVar1 != 2) {
if (iVar1 == 0) {
bVar4 = (byte)(param_3 >> 3) & 1;
goto joined_r0x00728a9a;
}
goto LAB_007289cc;
}
break;
}
}
else {
LAB_007289cc:
bVar4 = bVar2;
if ((((*(char **)(this + 0x7c) == "func_breakable") ||
(cVar3 = CBaseEntity::ClassMatchesComplex(this,"func_breakable"), cVar3 != '\0')) &&
(*(int *)(this + 0x100) != 0)) && (this[0x105] == (CBaseEntity)0x2))
goto joined_r0x00728a9a;
if ((*(char **)(this + 0x7c) == "func_breakable_surf") ||
(cVar3 = CBaseEntity::ClassMatchesComplex(this,"func_breakable_surf"), cVar3 != '\0')) {
if (this[0x105] == (CBaseEntity)0x2) goto joined_r0x00728a9a;
if (*(char **)(this + 0x7c) != "func_playerinfected_clip") goto LAB_00728a37;
}
else if (*(char **)(this + 0x7c) != "func_playerinfected_clip") {
LAB_00728a37:
cVar3 = CBaseEntity::ClassMatchesComplex(this,"func_playerinfected_clip");
if (cVar3 == '\0') {
if (*(int *)(nav_solid_props._28_4_ + 0x30) == 0) break;
if (*(char **)(this + 0x7c) != "prop_*") {
bVar4 = CBaseEntity::ClassMatchesComplex(this,"prop_*");
goto joined_r0x00728a9a;
}
}
}
}
}
local_cc = *(float *)param_2 - *(float *)param_1;
local_c8 = *(float *)(param_2 + 4) - *(float *)(param_1 + 4);
local_c4 = *(float *)(param_2 + 8) - *(float *)(param_1 + 8);
VectorNormalize((Vector *)&local_cc);
local_f4 = local_f4 + -1;
fVar7 = local_cc * 5.0 + local_64;
fVar6 = local_c8 * 5.0 + local_60;
fVar5 = local_c4 * 5.0 + local_5c;
} while (local_f4 != 0);
return local_44 == 1.0;
}
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.