CClientPath::VisibilityThink
0x008cef50 · 712 bytes · __thiscall
_ZN11CClientPath15VisibilityThinkEv
Decompiled
undefined (1 param)
/* CClientPath::VisibilityThink() */
void __thiscall CClientPath::VisibilityThink(CClientPath *this)
{
uint uVar1;
CBaseEntity *this_00;
CBaseEdict *this_01;
CBaseEntity *this_02;
char cVar2;
CClientPath CVar3;
int iVar4;
CNavArea *pCVar5;
TerrorNavArea *pTVar6;
undefined *puVar7;
ShortestPathCost local_51;
undefined4 local_50;
undefined4 local_4c;
undefined4 local_48;
undefined4 local_44;
undefined4 local_40;
undefined4 local_3c;
undefined4 local_38;
undefined4 local_34;
undefined4 local_30;
CBaseEntity *local_2c;
undefined4 local_28;
CBaseEntity *local_24;
undefined1 local_20;
undefined1 local_1f;
uVar1 = *(uint *)(this + 0x1050);
if (((((uVar1 == 0xffffffff) ||
(puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar7 + 8) != uVar1 >> 0xc)) ||
((this_00 = *(CBaseEntity **)(puVar7 + 4), this_00 == (CBaseEntity *)0x0 ||
(cVar2 = (**(code **)(*(int *)this_00 + 0x16c))(this_00), cVar2 == '\0')))) ||
((cVar2 = (**(code **)(*(int *)this_00 + 300))(this_00), cVar2 == '\0' ||
(iVar4 = CBaseEntity::GetTeamNumber(this_00), iVar4 != 3)))) {
this[0x1054] = (CClientPath)0x0;
}
else {
if (((byte)this[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
}
local_38 = *(undefined4 *)(this + 0x2e0);
local_2c = (CBaseEntity *)0x0;
local_34 = *(undefined4 *)(this + 0x2e4);
local_28 = 0x4cbebc20;
local_30 = *(undefined4 *)(this + 0x2e8);
local_20 = 1;
local_1f = 0;
local_24 = this_00;
ForEachSurvivor<ClosestSurvivorScan>((ClosestSurvivorScan *)&local_38);
this_02 = local_2c;
if (local_2c != (CBaseEntity *)0x0) {
CBaseEntity::SetNextThink((CBaseEntity *)this,*(float *)(gpGlobals + 0xc) + 0.25,(char *)0x0);
pCVar5 = (CNavArea *)(**(code **)(*(int *)this_00 + 0x52c))(this_00);
pTVar6 = (TerrorNavArea *)(**(code **)(*(int *)this_02 + 0x52c))(this_02);
if ((pCVar5 == *(CNavArea **)(this + 0x1048)) &&
(pTVar6 == (TerrorNavArea *)*(CNavArea **)(this + 0x104c))) {
return;
}
*(CNavArea **)(this + 0x1048) = pCVar5;
*(TerrorNavArea **)(this + 0x104c) = pTVar6;
if (((byte)this_02[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(this_02);
}
local_50 = *(undefined4 *)(this_02 + 0x2e0);
local_4c = *(undefined4 *)(this_02 + 0x2e4);
local_48 = *(undefined4 *)(this_02 + 0x2e8);
if (((byte)this_00[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(this_00);
}
local_44 = *(undefined4 *)(this_00 + 0x2e0);
local_40 = *(undefined4 *)(this_00 + 0x2e4);
local_3c = *(undefined4 *)(this_00 + 0x2e8);
CVar3 = (CClientPath)
NavAreaBuildPath<ShortestPathCost>
(pCVar5,(CNavArea *)pTVar6,(Vector *)&local_44,(Vector *)&local_50,&local_51
,(CNavArea **)0x0,0.0,3,false);
this[0x1054] = CVar3;
if (!(bool)CVar3) {
return;
}
*(undefined4 *)(this + 0x1044) = 0;
if (*(int *)(this + 0x1040) != 0) {
if (this[0x6c] == (CClientPath)0x0) {
this_01 = *(CBaseEdict **)(this + 0x30);
if (this_01 != (CBaseEdict *)0x0) {
*(uint *)this_01 = *(uint *)this_01 | 0x101;
iVar4 = CBaseEdict::GetChangeAccessor(this_01);
*(undefined2 *)(iVar4 + 2) = 0;
}
}
else {
this[0x70] = (CClientPath)((byte)this[0x70] | 1);
}
*(undefined4 *)(this + 0x1040) = 0;
}
for (; pTVar6 != (TerrorNavArea *)0x0; pTVar6 = *(TerrorNavArea **)(pTVar6 + 0x78)) {
AddArea(this,pTVar6);
}
FinishPath(this);
return;
}
}
CBaseEntity::SetNextThink((CBaseEntity *)this,*(float *)(gpGlobals + 0xc) + 1.0,(char *)0x0);
return;
}
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.