SurvivorBot::IsReachable
0x0093c7b0 · 263 bytes · __thiscall
_ZNK11SurvivorBot11IsReachableEP13CTerrorPlayer
Decompiled
undefined (2 params)
/* SurvivorBot::IsReachable(CTerrorPlayer*) const */
undefined4 __thiscall SurvivorBot::IsReachable(SurvivorBot *this,CTerrorPlayer *param_1)
{
CTerrorPlayer CVar1;
CNavArea *this_00;
undefined4 uVar2;
CNavArea *pCVar3;
float local_18;
float local_14;
if ((param_1 != (CTerrorPlayer *)0x0) &&
(uVar2 = (**(code **)(*(int *)param_1 + 300))(param_1), (char)uVar2 != '\0')) {
if (param_1 == (CTerrorPlayer *)this) {
return uVar2;
}
pCVar3 = (CNavArea *)(**(code **)(*(int *)param_1 + 0x52c))(param_1);
if ((param_1[0x39f1] == (CTerrorPlayer)0x0) ||
(this_00 = *(CNavArea **)(param_1 + 0x3a64), this_00 == (CNavArea *)0x0)) {
if (pCVar3 == (CNavArea *)0x0) {
return 0;
}
CVar1 = param_1[0x14d];
this_00 = pCVar3;
}
else {
CVar1 = param_1[0x14d];
}
if (((byte)CVar1 & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
}
CNavArea::GetClosestPointOnArea(this_00,(Vector *)(param_1 + 0x2e0),(Vector *)&local_18);
if (((byte)param_1[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
}
if ((*(float *)(param_1 + 0x2e0) - local_18) * (*(float *)(param_1 + 0x2e0) - local_18) +
(*(float *)(param_1 + 0x2e4) - local_14) * (*(float *)(param_1 + 0x2e4) - local_14) <=
10000.0) {
pCVar3 = (CNavArea *)(**(code **)(*(int *)this + 0x52c))(this);
uVar2 = IsReachable(this,pCVar3,this_00);
return uVar2;
}
}
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.