CFuncTrackTrain::Use
0x00b10900 · 272 bytes · __thiscall
_ZN15CFuncTrackTrain3UseEP11CBaseEntityS1_8USE_TYPEf
Decompiled
undefined (5 params)
/* CFuncTrackTrain::Use(CBaseEntity*, CBaseEntity*, USE_TYPE, float) */
void __thiscall
CFuncTrackTrain::Use
(CFuncTrackTrain *param_1,undefined4 param_2,undefined4 param_3,int param_4,float param_5)
{
float fVar1;
bool bVar2;
float fVar3;
if (param_4 != 2) {
return;
}
bVar2 = true;
fVar3 = 1.0;
fVar1 = (param_5 +
(float)((int)(*(float *)(param_1 + 0x11c) * 4.0) / (int)*(float *)(param_1 + 0x484))) *
0.25;
if (fVar1 <= 1.0) {
if (-0.25 <= fVar1) {
if (((byte)param_1[0x148] & 4) == 0) {
bVar2 = 0.0 <= fVar1;
fVar3 = ABS(fVar1);
}
else {
fVar3 = 0.0;
if (0.0 <= fVar1) {
fVar3 = ABS(fVar1);
}
}
}
else {
fVar3 = 0.25;
bVar2 = false;
if ((*(uint *)(param_1 + 0x148) & 4) != 0) {
fVar3 = 0.0;
bVar2 = true;
}
}
}
SetDirForward(param_1,bVar2);
SetSpeed(param_1,fVar3 * *(float *)(param_1 + 0x484),false);
return;
}
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.