CFuncTrackTrain::DoUpdateOrientation
0x00b0d170 · 577 bytes · __thiscall
_ZN15CFuncTrackTrain19DoUpdateOrientationERK6QAngleS2_f
Decompiled
undefined (4 params)
/* CFuncTrackTrain::DoUpdateOrientation(QAngle const&, QAngle const&, float) */
void __thiscall
CFuncTrackTrain::DoUpdateOrientation
(CFuncTrackTrain *this,QAngle *param_1,QAngle *param_2,float param_3)
{
float fVar1;
longdouble lVar2;
float fVar3;
float fVar4;
float local_28;
float local_24;
float local_20;
if (((byte)this[0x148] & 1) == 0) {
lVar2 = (longdouble)AngleDistance(*(float *)param_2,*(float *)param_1);
fVar3 = (float)lVar2;
lVar2 = (longdouble)AngleDistance(*(float *)(param_2 + 4),*(float *)(param_1 + 4));
local_24 = (float)lVar2;
if (ABS(fVar3) < 0.1) goto LAB_00b0d1d0;
}
else {
lVar2 = (longdouble)AngleDistance(*(float *)(param_2 + 4),*(float *)(param_1 + 4));
local_24 = (float)lVar2;
LAB_00b0d1d0:
fVar3 = 0.0;
}
if (ABS(local_24) < 0.1) {
local_24 = 0.0;
}
if (param_3 == 0.0) {
param_3 = 0.1;
}
local_24 = local_24 / param_3;
local_20 = *(float *)(this + 0x288);
local_28 = fVar3 / param_3;
fVar3 = *(float *)(this + 0x474);
if (fVar3 != 0.0) {
fVar1 = *(float *)(param_1 + 8);
if (local_24 < -5.0) {
fVar4 = -fVar3;
}
else {
fVar4 = fVar3;
if (local_24 <= 5.0) {
lVar2 = (longdouble)ApproachAngle(0.0,fVar1,fVar3 * 4.0);
lVar2 = (longdouble)AngleDistance((float)lVar2,fVar1);
local_20 = (float)lVar2 * 4.0;
goto LAB_00b0d29b;
}
}
lVar2 = (longdouble)ApproachAngle(fVar4,fVar1,fVar3 + fVar3);
lVar2 = (longdouble)AngleDistance((float)lVar2,fVar1);
local_20 = (float)lVar2;
}
LAB_00b0d29b:
CBaseEntity::SetLocalAngularVelocity((CBaseEntity *)this,(QAngle *)&local_28);
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.