IsRunningAway
0x00995d60 · 380 bytes · __regparm3
_ZL13IsRunningAwayP20CBaseCombatCharacterP13CTerrorPlayer
Decompiled
undefined (2 params)
/* IsRunningAway(CBaseCombatCharacter*, CTerrorPlayer*) */
bool __regparm3 IsRunningAway(CBaseCombatCharacter *param_1,CTerrorPlayer *param_2)
{
float fVar1;
float fVar2;
bool bVar3;
float fVar4;
float fVar5;
float local_18;
float local_14;
float local_10;
if (((byte)param_2[0x14d] & 0x10) != 0) {
CBaseEntity::CalcAbsoluteVelocity((CBaseEntity *)param_2);
}
fVar5 = *(float *)(param_2 + 0x274);
fVar1 = *(float *)(param_2 + 0x278);
fVar2 = *(float *)(param_2 + 0x27c);
if (((byte)param_1[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
}
if (((byte)param_2[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_2);
}
local_14 = *(float *)(param_2 + 0x2e4) - *(float *)(param_1 + 0x2e4);
local_10 = *(float *)(param_2 + 0x2e8) - *(float *)(param_1 + 0x2e8);
local_18 = *(float *)(param_2 + 0x2e0) - *(float *)(param_1 + 0x2e0);
VectorNormalize((Vector *)&local_18);
bVar3 = false;
fVar4 = fVar5 * fVar5 + fVar1 * fVar1 + fVar2 * fVar2;
if (576.0 < fVar4) {
fVar5 = fVar1 * local_14 + fVar5 * local_18 + fVar2 * local_10;
bVar3 = fVar4 * 0.5 < fVar5 * fVar5;
}
return bVar3;
}
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.