ChargerAttack::ShouldEvadeVictim
0x00a890f0 · 212 bytes · __thiscall
_ZN13ChargerAttack17ShouldEvadeVictimEP7ChargerP13CTerrorPlayer
Decompiled
undefined (3 params)
/* ChargerAttack::ShouldEvadeVictim(Charger*, CTerrorPlayer*) */
bool __thiscall
ChargerAttack::ShouldEvadeVictim(ChargerAttack *this,Charger *param_1,CTerrorPlayer *param_2)
{
float fVar1;
CTerrorPlayer CVar2;
bool bVar3;
if (((byte)param_2[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_2);
}
fVar1 = *(float *)(param_2 + 0x2e8);
if (((byte)param_1[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
}
bVar3 = false;
if (36.0 < fVar1 - *(float *)(param_1 + 0x2e8)) {
if (((byte)param_1[0x14d] & 8) == 0) {
CVar2 = param_2[0x14d];
}
else {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
CVar2 = param_2[0x14d];
}
if (((byte)CVar2 & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_2);
}
bVar3 = (*(float *)(param_2 + 0x2e0) - *(float *)(param_1 + 0x2e0)) *
(*(float *)(param_2 + 0x2e0) - *(float *)(param_1 + 0x2e0)) +
(*(float *)(param_2 + 0x2e4) - *(float *)(param_1 + 0x2e4)) *
(*(float *)(param_2 + 0x2e4) - *(float *)(param_1 + 0x2e4)) <= 14400.0;
}
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.