CFuncTrackTrain::OnControls
0x00b092f0 · 344 bytes · __thiscall
_ZN15CFuncTrackTrain10OnControlsEP11CBaseEntity
Decompiled
undefined (2 params)
/* CFuncTrackTrain::OnControls(CBaseEntity*) */
bool __thiscall CFuncTrackTrain::OnControls(CFuncTrackTrain *this,CBaseEntity *param_1)
{
bool bVar1;
float fVar2;
float fVar3;
float fVar4;
float fVar5;
float fVar6;
float local_4c;
float local_48;
float local_44;
float local_3c;
float local_38;
float local_34;
float local_2c;
float local_28;
float local_24;
bVar1 = false;
if (((byte)this[0x148] & 2) == 0) {
fVar4 = *(float *)(param_1 + 0x39c) - *(float *)(this + 0x39c);
fVar5 = *(float *)(param_1 + 0x3a0) - *(float *)(this + 0x3a0);
fVar6 = *(float *)(param_1 + 0x3a4) - *(float *)(this + 0x3a4);
SetupMatrixAngles((QAngle *)&local_4c);
fVar2 = fVar5 * local_3c + fVar4 * local_4c + fVar6 * local_2c;
if ((((*(float *)(this + 0x448) <= fVar2) &&
(fVar3 = local_38 * fVar5 + local_48 * fVar4 + fVar6 * local_28,
*(float *)(this + 0x44c) <= fVar3)) &&
(fVar4 = fVar5 * local_34 + fVar4 * local_44 + local_24 * fVar6,
*(float *)(this + 0x450) <= fVar4)) &&
((fVar2 < *(float *)(this + 0x454) || fVar2 == *(float *)(this + 0x454) &&
(fVar3 < *(float *)(this + 0x458) || fVar3 == *(float *)(this + 0x458))))) {
bVar1 = fVar4 < *(float *)(this + 0x45c) || fVar4 == *(float *)(this + 0x45c);
}
}
return bVar1;
}
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.