CBaseCombatCharacter::IsAbleToSee
0x003ffd40 · 523 bytes · __thiscall
_ZN20CBaseCombatCharacter11IsAbleToSeeEPS_NS_20FieldOfViewCheckTypeE
Decompiled
undefined (3 params)
/* CBaseCombatCharacter::IsAbleToSee(CBaseCombatCharacter*,
CBaseCombatCharacter::FieldOfViewCheckType) */
undefined4 __thiscall
CBaseCombatCharacter::IsAbleToSee
(CBaseCombatCharacter *this,CBaseCombatCharacter *param_1,int param_3)
{
float *pfVar1;
float fVar2;
float fVar5;
char cVar6;
byte bVar7;
byte bVar8;
undefined4 uVar9;
int iVar10;
int iVar11;
CNavArea *pCVar12;
longdouble lVar13;
float local_40;
float local_3c;
float local_38;
float local_34;
float local_30;
float local_2c;
float local_28;
float local_24;
float local_20;
float fVar3;
float fVar4;
ComputeSeeTestPosition((Vector *)&local_40,this);
ComputeSeeTestPosition((Vector *)&local_34,param_1);
local_28 = local_34 - local_40;
local_24 = local_30 - local_3c;
local_20 = local_2c - local_38;
lVar13 = (longdouble)VectorNormalize((Vector *)&local_28);
fVar5 = (float)lVar13;
uVar9 = (**(code **)(*(int *)this + 0x408))(this,fVar5);
if ((char)uVar9 == '\0') {
pfVar1 = (float *)(NavObscureRange._28_4_ + 0x2c);
fVar2 = *pfVar1;
fVar3 = *pfVar1;
fVar4 = *pfVar1;
if ((fVar5 < fVar4 || fVar5 == fVar3) ||
((iVar10 = (**(code **)(*(int *)param_1 + 0x52c))(param_1), iVar10 != 0 &&
((*(byte *)(iVar10 + 0x12d) & 0x10) == 0)))) {
iVar10 = CCombatCharVisCache::LookupVisibility
((CCombatCharVisCache *)s_CombatCharVisCache,this,param_1);
iVar11 = CCombatCharVisCache::HasVisibility
((CCombatCharVisCache *)s_CombatCharVisCache,iVar10);
if (iVar11 == 0) {
cVar6 = ComputeLOS(this,this,2,param_1,2);
if (cVar6 == '\0') {
CCombatCharVisCache::RegisterVisibility
((CCombatCharVisCache *)s_CombatCharVisCache,iVar10,false,false);
return uVar9;
}
if ((NAN(fVar5) || NAN(fVar2)) || (fVar5 < fVar4 || fVar5 == fVar3)) {
CCombatCharVisCache::RegisterVisibility
((CCombatCharVisCache *)s_CombatCharVisCache,iVar10,true,true);
}
else {
pCVar12 = (CNavArea *)(**(code **)(*(int *)param_1 + 0x52c))(param_1);
bVar7 = ComputeTargetIsInDarkness(this,(Vector *)&local_40,pCVar12,(Vector *)&local_34);
pCVar12 = (CNavArea *)(**(code **)(*(int *)this + 0x52c))(this);
bVar8 = ComputeTargetIsInDarkness(this,(Vector *)&local_34,pCVar12,(Vector *)&local_40);
CCombatCharVisCache::RegisterVisibility
((CCombatCharVisCache *)s_CombatCharVisCache,iVar10,(bool)(bVar7 ^ 1),
(bool)(bVar8 ^ 1));
if ((bool)(bVar7 ^ 1) == false) {
return uVar9;
}
}
}
else if (iVar11 != 1) {
return 0;
}
if (param_3 == 0) {
uVar9 = (**(code **)(*(int *)this + 0x424))(this,param_1);
return uVar9;
}
return 1;
}
}
return 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.