CFuncTrackTrain::UpdateOrientationAtPathTracks
0x00b0d3c0 · 594 bytes · __thiscall
_ZN15CFuncTrackTrain29UpdateOrientationAtPathTracksEP10CPathTrackS1_RK6Vectorf
Decompiled
undefined (5 params)
/* CFuncTrackTrain::UpdateOrientationAtPathTracks(CPathTrack*, CPathTrack*, Vector const&, float) */
void __thiscall
CFuncTrackTrain::UpdateOrientationAtPathTracks
(CFuncTrackTrain *this,CPathTrack *param_1,CPathTrack *param_2,Vector *param_3,
float param_4)
{
int iVar1;
float fVar2;
CPathTrack *local_50;
float local_4c;
float local_48;
float local_44;
float local_40;
float local_3c;
float local_38;
undefined4 local_34;
undefined4 local_30;
undefined4 local_2c;
undefined4 local_28;
undefined4 local_24;
undefined4 local_20;
if (*(CPathTrack **)(this + 0x440) != (CPathTrack *)0x0) {
local_4c = *(float *)(this + 0x39c);
local_50 = (CPathTrack *)0x0;
local_48 = *(float *)(this + 0x3a0);
local_44 = *(float *)(this + 0x3a4) - *(float *)(this + 0x480);
fVar2 = *(float *)(this + 0x444);
if (fVar2 <= 0.0) {
fVar2 = 100.0;
if (*(float *)(this + 0x488) != 1.0) {
fVar2 = -100.0;
}
}
else if (*(float *)(this + 0x488) != 1.0) {
fVar2 = -fVar2;
}
CPathTrack::LookAhead(*(CPathTrack **)(this + 0x440),(Vector *)&local_4c,fVar2,0,&local_50);
local_44 = *(float *)(this + 0x480) + local_44;
local_40 = local_4c - *(float *)(this + 0x39c);
local_3c = local_48 - *(float *)(this + 0x3a0);
local_38 = local_44 - *(float *)(this + 0x3a4);
if (*(float *)(this + 0x488) != 1.0) {
local_40 = -local_40;
local_3c = -local_3c;
local_38 = -local_38;
}
VectorAngles((Vector *)&local_40,(QAngle *)&local_34);
FixupAngles((QAngle *)&local_34);
if ((this[0x4ec] != (CFuncTrackTrain)0x0) && (local_50 != (CPathTrack *)0x0)) {
iVar1 = CPathTrack::GetOrientationType(local_50);
if (iVar1 == 2) {
CPathTrack::GetOrientation(SUB41((QAngle *)&local_28,0));
local_34 = local_28;
local_30 = local_24;
local_2c = local_20;
}
}
local_28 = *(undefined4 *)(this + 0x3a8);
local_24 = *(undefined4 *)(this + 0x3ac);
local_20 = *(undefined4 *)(this + 0x3b0);
FixupAngles((QAngle *)&local_28);
if ((param_1 == (CPathTrack *)0x0) || ((local_40 == 0.0 && (local_3c == 0.0)))) {
local_34 = local_28;
local_30 = local_24;
local_2c = local_20;
}
DoUpdateOrientation(this,(QAngle *)&local_28,(QAngle *)&local_34,param_4);
}
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.