diff --git a/src/gtasa/effects/custom/vehicle/SwapSteeringAxleEffect.cpp b/src/gtasa/effects/custom/vehicle/SwapSteeringAxleEffect.cpp new file mode 100644 index 00000000..3c700b0f --- /dev/null +++ b/src/gtasa/effects/custom/vehicle/SwapSteeringAxleEffect.cpp @@ -0,0 +1,33 @@ +#include "util/EffectBase.h" +#include "util/GameUtil.h" + +class SwapSteeringAxleEffect : public EffectBase +{ +public: + void + OnTick (EffectInstance *inst) override + { + auto *player = FindPlayerPed (); + if (!player) return; + + auto *vehicle = player->m_pVehicle; + + if (vehicle && vehicle->m_pDriver == player) + { + const int vehicleId = vehicle->m_nModelIndex; + auto vehicleType = CModelInfo::IsVehicleModelType (vehicleId); + switch (vehicleType) + { + case VEHICLE_AUTOMOBILE: + case VEHICLE_MTRUCK: + case VEHICLE_QUAD: + vehicle->m_nHandlingFlags.bSteerRearwheels = 1; + break; + default: break; + } + } + } +}; + +DEFINE_EFFECT (SwapSteeringAxleEffect, "effect_swap_steering_axle", + GROUP_HANDLING); \ No newline at end of file