CBaseCombatCharacter::IsAbleToSee
0x003fff60 · 419 bytes · __thiscall
_ZN20CBaseCombatCharacter11IsAbleToSeeEPK11CBaseEntityNS_20FieldOfViewCheckTypeE
Decompiled
undefined (3 params)
/* CBaseCombatCharacter::IsAbleToSee(CBaseEntity const*, CBaseCombatCharacter::FieldOfViewCheckType)
*/
undefined4 __thiscall
CBaseCombatCharacter::IsAbleToSee(CBaseCombatCharacter *this,int *param_1,int param_3)
{
float fVar1;
char cVar2;
int iVar3;
undefined4 uVar4;
float *pfVar5;
CNavArea *pCVar6;
longdouble lVar7;
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;
iVar3 = (**(code **)(*param_1 + 0x144))(param_1);
if (iVar3 == 0) {
(**(code **)(*(int *)this + 0x234))((Vector *)&local_40,this);
pfVar5 = (float *)(**(code **)(*param_1 + 0x288))(param_1);
local_34 = *pfVar5;
local_30 = pfVar5[1];
local_28 = local_34 - local_40;
local_2c = pfVar5[2];
local_24 = local_30 - local_3c;
local_20 = local_2c - local_38;
lVar7 = (longdouble)VectorNormalize((Vector *)&local_28);
fVar1 = (float)lVar7;
cVar2 = (**(code **)(*(int *)this + 0x408))(this,fVar1);
if ((cVar2 != '\0') || (uVar4 = ComputeLOS(this,this,1,param_1,0), (char)uVar4 == '\0')) {
return 0;
}
if (*(float *)(NavObscureRange._28_4_ + 0x2c) <= fVar1 &&
fVar1 != *(float *)(NavObscureRange._28_4_ + 0x2c)) {
pCVar6 = (CNavArea *)
CNavMesh::GetNearestNavArea
(TheNavMesh,(Vector *)&local_34,false,100.0,false,true,false);
if (pCVar6 == (CNavArea *)0x0) {
return 0;
}
if (((byte)pCVar6[0x12d] & 0x10) != 0) {
return 0;
}
cVar2 = ComputeTargetIsInDarkness(this,(Vector *)&local_40,pCVar6,(Vector *)&local_34);
if (cVar2 != '\0') {
return 0;
}
}
if (param_3 == 0) {
uVar4 = (**(code **)(*(int *)this + 0x428))(this,&local_34);
}
}
else {
uVar4 = IsAbleToSee(this,iVar3,param_3);
}
return uVar4;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
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.
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.