TerrorNavArea::IsPotentiallyVisible
0x00975c30 · 317 bytes · __thiscall
_ZNK13TerrorNavArea20IsPotentiallyVisibleEPKS_b
Decompiled
undefined (3 params)
/* TerrorNavArea::IsPotentiallyVisible(TerrorNavArea const*, bool) const */
bool __thiscall
TerrorNavArea::IsPotentiallyVisible(TerrorNavArea *this,TerrorNavArea *param_1,bool param_2)
{
int iVar1;
byte *pbVar2;
short local_e;
if (param_1 != (TerrorNavArea *)0x0) {
if (param_1 == this) {
return true;
}
if (((param_2) || (((byte)param_1[0x12d] & 0x10) == 0)) ||
((*(float *)(param_1 + 0x34) - *(float *)(this + 0x34)) *
(*(float *)(param_1 + 0x34) - *(float *)(this + 0x34)) +
(*(float *)(param_1 + 0x2c) - *(float *)(this + 0x2c)) *
(*(float *)(param_1 + 0x2c) - *(float *)(this + 0x2c)) +
(*(float *)(param_1 + 0x30) - *(float *)(this + 0x30)) *
(*(float *)(param_1 + 0x30) - *(float *)(this + 0x30)) <
*(float *)(NavObscureRange._28_4_ + 0x2c) * *(float *)(NavObscureRange._28_4_ + 0x2c))) {
if (((uint)param_1 & 3) != 0) {
Error("Bad nav area pointer");
}
local_e = *(short *)(param_1 + 0x90) << 2;
if (((*(size_t *)(this + 0x13c) != 0) &&
(pbVar2 = bsearch(&local_e,*(void **)(this + 0x134),*(size_t *)(this + 0x13c),2,
AreaSortFunc), pbVar2 != (byte *)0x0)) ||
((iVar1 = *(int *)(this + 0x130), iVar1 != 0 &&
((*(size_t *)(iVar1 + 0x13c) != 0 &&
(pbVar2 = bsearch(&local_e,*(void **)(iVar1 + 0x134),*(size_t *)(iVar1 + 0x13c),2,
AreaSortFunc), pbVar2 != (byte *)0x0)))))) {
return (*pbVar2 & 3) != 0;
}
}
}
return false;
}
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.