L L4D2node

CFuncTrackChange::UpdateTrain

0x00b0e750 · 596 bytes · __thiscall

_ZN16CFuncTrackChange11UpdateTrainER6QAngle

Decompiled

undefined (2 params)

/* CFuncTrackChange::UpdateTrain(QAngle&) */

void __thiscall CFuncTrackChange::UpdateTrain(CFuncTrackChange *this,QAngle *param_1)

{
  int iVar1;
  float fVar2;
  float fVar3;
  float fVar4;
  float local_50;
  float local_48;
  float local_44;
  float local_40;
  float local_3c;
  float local_38;
  float local_34;
  float local_30;
  float local_2c;
  float local_28;
  float local_24;
  float local_20;
  float local_1c;
  float local_18;
  float local_14;
  float local_10;
  
  if (*(float *)(this + 0x2d8) < 0.0) {
    local_50 = -1.0;
  }
  else {
    local_50 = *(float *)(this + 0x2d8) - *(float *)(this + 0x2d0);
  }
  if (((byte)this[0x14d] & 0x10) != 0) {
    CBaseEntity::CalcAbsoluteVelocity((CBaseEntity *)this);
  }
  CBaseEntity::SetAbsVelocity(*(CBaseEntity **)(this + 0x4f4),(Vector *)(this + 0x274));
  CBaseEntity::SetLocalAngularVelocity(*(CBaseEntity **)(this + 0x4f4),(QAngle *)(this + 0x280));
  CBaseEntity::SetMoveDoneTime(*(CBaseEntity **)(this + 0x4f4),local_50);
  if (0.0 < local_50) {
    iVar1 = *(int *)(this + 0x4f4);
    local_48 = *(float *)param_1 - *(float *)(this + 0x3a8);
    local_44 = *(float *)(param_1 + 4) - *(float *)(this + 0x3ac);
    fVar4 = *(float *)(iVar1 + 0x39c) - *(float *)(this + 0x39c);
    fVar2 = *(float *)(iVar1 + 0x3a0) - *(float *)(this + 0x3a0);
    fVar3 = *(float *)(iVar1 + 0x3a4) - *(float *)(this + 0x3a4);
    local_40 = *(float *)(param_1 + 8) - *(float *)(this + 0x3b0);
    AngleVectorsTranspose
              ((QAngle *)&local_48,(Vector *)&local_3c,(Vector *)&local_30,(Vector *)&local_24);
    local_50 = 1.0 / local_50;
    if (((byte)this[0x14d] & 0x10) != 0) {
      CBaseEntity::CalcAbsoluteVelocity((CBaseEntity *)this);
    }
    local_18 = ((local_38 * fVar2 + local_3c * fVar4 + local_34 * fVar3) - fVar4) * local_50 +
               *(float *)(this + 0x274);
    local_14 = ((local_2c * fVar2 + local_30 * fVar4 + local_28 * fVar3) - fVar2) * local_50 +
               *(float *)(this + 0x278);
    local_10 = ((fVar2 * local_20 + fVar4 * local_24 + local_1c * fVar3) - fVar3) * local_50 +
               *(float *)(this + 0x27c);
    CBaseEntity::SetAbsVelocity(*(CBaseEntity **)(this + 0x4f4),(Vector *)&local_18);
  }
  return;
}

SourceMod gamedata

paste into addons/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.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)