CTerrorPlayer::IsAheadOf
0x009ab7b0 · 422 bytes · __thiscall
_ZNK13CTerrorPlayer9IsAheadOfEPS_
Decompiled
undefined (2 params)
/* CTerrorPlayer::IsAheadOf(CTerrorPlayer*) const */
undefined4 __thiscall CTerrorPlayer::IsAheadOf(CTerrorPlayer *this,CTerrorPlayer *param_1)
{
int iVar1;
TerrorNavArea *this_00;
int iVar2;
TerrorNavArea *pTVar3;
longdouble lVar4;
float local_24;
if ((param_1 != (CTerrorPlayer *)0x0) &&
(iVar1 = (**(code **)(*(int *)param_1 + 0x52c))(param_1), iVar1 != 0)) {
iVar1 = (**(code **)(*(int *)param_1 + 0x52c))(param_1);
iVar2 = CNavArea::m_masterMarker + 1;
CNavArea::m_masterMarker = 1;
if (iVar2 != 0) {
CNavArea::m_masterMarker = iVar2;
}
this_00 = *(TerrorNavArea **)(TheNavMesh + 0x600);
if ((this_00 != (TerrorNavArea *)0x0) && (*(int *)(this_00 + 0x3c) != CNavArea::m_masterMarker))
{
pTVar3 = (TerrorNavArea *)0x0;
local_24 = 1e+08;
do {
*(int *)(this_00 + 0x3c) = CNavArea::m_masterMarker;
if (((byte)this[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
}
lVar4 = (longdouble)
CNavArea::GetDistanceSquaredToPoint((CNavArea *)this_00,(Vector *)(this + 0x2e0));
if ((float)lVar4 < local_24) {
pTVar3 = this_00;
local_24 = (float)lVar4;
}
if (*(int *)(ZombieDebugSpawnAhead._28_4_ + 0x30) != 0) {
(**(code **)(*(int *)this_00 + 0x54))(this_00,0,0xff,0,100,0x3f8ccccd,1);
}
this_00 = (TerrorNavArea *)TerrorNavArea::GetNextEscapeStep(this_00,(NavTraverseType *)0x0);
} while ((this_00 != (TerrorNavArea *)0x0) &&
(*(int *)(this_00 + 0x3c) != CNavArea::m_masterMarker));
if (pTVar3 != (TerrorNavArea *)0x0) {
if (*(int *)(ZombieDebugSpawnAhead._28_4_ + 0x30) != 0) {
(**(code **)(*(int *)pTVar3 + 0x54))(pTVar3,0xff,0,0,0xff,0x3f8ccccd,1);
}
if (*(float *)(iVar1 + 0x154) <= *(float *)(pTVar3 + 0x154) &&
*(float *)(pTVar3 + 0x154) != *(float *)(iVar1 + 0x154)) {
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.