L L4D2node

CFourWheelVehiclePhysics::SteeringTurnAnalog

0x006aee30 · 315 bytes · __thiscall

_ZN24CFourWheelVehiclePhysics18SteeringTurnAnalogEfRK15vehicleparams_tf

Decompiled

undefined (4 params)

/* CFourWheelVehiclePhysics::SteeringTurnAnalog(float, vehicleparams_t const&, float) */

void __thiscall
CFourWheelVehiclePhysics::SteeringTurnAnalog
          (CFourWheelVehiclePhysics *this,float param_1,vehicleparams_t *param_2,float param_3)

{
  longdouble lVar1;
  uint uVar2;
  float fVar3;
  float fVar4;
  float fVar5;
  float fVar6;
  
  uVar2 = -(uint)(0.0 < param_3 * 0.0025);
  fVar6 = *(float *)(xbox_steering_deadzone._28_4_ + 0x2c);
  fVar4 = (float)(~uVar2 & 0xbf800000 | uVar2 & 0x3f800000);
  fVar3 = ABS(param_3 * 0.0025);
  if (fVar6 == 1.0) {
    fVar4 = (float)(-(uint)(1.0 <= fVar3) & (uint)fVar4);
  }
  else {
    fVar6 = (fVar3 - fVar6) / (1.0 - fVar6);
    if (1.0 <= fVar6) {
      fVar6 = 1.0;
    }
    if (fVar6 <= 0.0) {
      fVar6 = 0.0;
    }
    fVar4 = fVar6 * fVar4;
  }
  fVar6 = *(float *)(param_2 + 0x278);
  fVar3 = *(float *)(param_2 + 0x274);
  fVar5 = *(float *)(param_2 + 0x264);
  if (fVar6 == fVar3) {
    fVar5 = (float)(~-(uint)(param_1 < fVar6) & (uint)*(float *)(param_2 + 0x268) |
                   (uint)fVar5 & -(uint)(param_1 < fVar6));
  }
  else {
    fVar6 = (param_1 - fVar3) / (fVar6 - fVar3);
    if (1.0 <= fVar6) {
      fVar6 = 1.0;
    }
    if (fVar6 <= 0.0) {
      fVar6 = 0.0;
    }
    fVar5 = fVar5 + fVar6 * (*(float *)(param_2 + 0x268) - fVar5);
  }
  fVar6 = *(float *)(param_2 + 0x288);
  this[0x21] = (CFourWheelVehiclePhysics)0x1;
  fVar5 = fVar6 * *(float *)(gpGlobals + 0x10) * fVar5;
  if (fVar5 != 0.0) {
    lVar1 = (longdouble)Approach(fVar4,*(float *)(this + 0x10),fVar5);
    fVar4 = (float)lVar1;
  }
  *(float *)(this + 0x10) = fVar4;
  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)