IVision::IsLineOfSightClear
0x0075c6a0 · 996 bytes · __thiscall
_ZNK7IVision18IsLineOfSightClearERK6Vector
Decompiled
undefined (2 params)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* IVision::IsLineOfSightClear(Vector const&) const */
byte __thiscall IVision::IsLineOfSightClear(IVision *this,Vector *param_1)
{
uint *puVar1;
char cVar2;
int iVar3;
int iVar4;
int *piVar5;
IHandleEntity *pIVar6;
float *pfVar7;
byte bVar8;
undefined4 local_f4;
undefined4 local_f0;
undefined4 local_e8;
undefined4 local_e4;
int local_e0;
undefined **local_dc [4];
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];
Vector local_64 [32];
float local_44;
byte local_39;
local_f4 = 0;
local_f0 = 0;
if (_towlower == 0) {
local_e0 = 0;
}
else {
(**(code **)(_towlower + 0x50))
(_towlower,&local_f4,0,0,0,0,
"/data/src/game/server/nextbot/nextbotvisioninterface.cpp",0x20d,
&IsLineOfSightClear(Vector_const&)::tm_fmt,"(%s)%s","NextBot",
"IVision::IsLineOfSightClear");
local_e0 = _towlower;
}
iVar4 = _DAT_0105db00;
local_e8 = local_f4;
local_e4 = local_f0;
if ((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) {
/* try { // try from 0075c770 to 0075c774 has its CatchHandler @ 0075cabe */
iVar3 = ThreadGetCurrentId();
if (iVar4 == iVar3) {
if ((char *)*_DAT_0105d15c != "IVision::IsLineOfSightClear") {
/* try { // try from 0075ca10 to 0075ca33 has its CatchHandler @ 0075cabe */
_DAT_0105d15c =
(int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xcaa17d,(char *)0x0,0xca8906);
}
puVar1 = (uint *)(_DAT_0105d1e8 + 4 + _DAT_0105d15c[0x1c] * 8);
*puVar1 = *puVar1 | 4;
CVProfNode::EnterScope();
DAT_0105d158 = '\0';
}
}
if (IsLineOfSightClear(Vector_const&)::_counter == '\0') {
iVar4 = __cxa_guard_acquire(&IsLineOfSightClear(Vector_const&)::_counter);
if (iVar4 != 0) {
/* try { // try from 0075ca57 to 0075ca5b has its CatchHandler @ 0075ca8e */
IsLineOfSightClear(Vector_const&)::_counter =
(int *)CVProfile::FindOrCreateCounter
(&g_VProfCurrentProfile,"IVision::IsLineOfSightClear",0);
__cxa_guard_release(&IsLineOfSightClear(Vector_const&)::_counter);
__cxa_atexit(CVProfCounter::~CVProfCounter,&IsLineOfSightClear(Vector_const&)::_counter,
&__dso_handle);
}
}
*IsLineOfSightClear(Vector_const&)::_counter = *IsLineOfSightClear(Vector_const&)::_counter + 1;
/* try { // try from 0075c7a7 to 0075c91a has its CatchHandler @ 0075cac2 */
piVar5 = (int *)(**(code **)(*(int *)this + 0xb0))(this);
pIVar6 = (IHandleEntity *)(**(code **)(*piVar5 + 0xb4))(piVar5);
CTraceFilterSimple::CTraceFilterSimple
((CTraceFilterSimple *)local_dc,pIVar6,0,VisionTraceFilterFunction);
local_dc[0] = &PTR_ShouldHitEntity_00caa2d0;
pfVar7 = (float *)(**(code **)(**(int **)(this + 0x14) + 0xb8))(*(int **)(this + 0x14));
local_bc = *(float *)param_1 - *pfVar7;
local_b8 = *(float *)(param_1 + 4) - pfVar7[1];
local_b4 = *(float *)(param_1 + 8) - pfVar7[2];
local_88 = 1;
local_8c = 0;
local_94 = 0;
local_98 = 0;
local_9c = 0;
local_87 = local_bc * local_bc + local_b8 * local_b8 + local_b4 * local_b4 != 0.0;
local_a4 = 0;
local_a8 = 0;
local_ac = 0;
local_cc = *pfVar7;
local_c8 = pfVar7[1];
local_c4 = pfVar7[2];
(**(code **)(*enginetrace + 0x14))
(enginetrace,&local_cc,0x2006041,(CTraceFilterSimple *)local_dc,local_70);
if (*(int *)(r_visualizetraces._28_4_ + 0x30) != 0) {
DebugDrawLine(local_70,local_64,0xff,0,0,true,-1.0);
}
iVar4 = _DAT_0105db00;
bVar8 = 0;
if (1.0 <= local_44) {
bVar8 = local_39 ^ 1;
}
if ((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) {
iVar3 = ThreadGetCurrentId();
if (iVar4 == iVar3) {
cVar2 = CVProfNode::ExitScope();
if (cVar2 != '\0') {
_DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
}
DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
}
}
if (local_e0 != 0) {
(**(code **)(local_e0 + 0x54))(local_e0,local_e8,local_e4,0,0,0);
}
return bVar8;
}
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.