diff --git a/module/Entity/Vehicle.cpp b/module/Entity/Vehicle.cpp index 49bca0a9..69fe1f48 100644 --- a/module/Entity/Vehicle.cpp +++ b/module/Entity/Vehicle.cpp @@ -342,6 +342,28 @@ void CVehicle::Explode() const _Func->ExplodeVehicle(m_ID); } +// ------------------------------------------------------------------------------------------------ +void CVehicle::FlattenTyres(bool toggle) const +{ + // Validate the managed identifier + Validate(); + // Perform the requested operation + if(toggle) + { + _Func->SetVehicleTyreStatus(m_ID, 0, 0); + _Func->SetVehicleTyreStatus(m_ID, 1, 0); + _Func->SetVehicleTyreStatus(m_ID, 2, 0); + _Func->SetVehicleTyreStatus(m_ID, 3, 0); + } + else + { + _Func->SetVehicleTyreStatus(m_ID, 0, 1); + _Func->SetVehicleTyreStatus(m_ID, 1, 1); + _Func->SetVehicleTyreStatus(m_ID, 2, 1); + _Func->SetVehicleTyreStatus(m_ID, 3, 1); + } +} + // ------------------------------------------------------------------------------------------------ bool CVehicle::IsWrecked() const { @@ -807,6 +829,7 @@ void CVehicle::Fix() const // Perform the requested operation _Func->SetVehicleHealth(m_ID, 1000); _Func->SetVehicleDamageData(m_ID, 0); + _Func->SetVehicleLightsData(m_ID, _Func->GetVehicleLightsData(m_ID) & 0xFFFFFF00); } // ------------------------------------------------------------------------------------------------ @@ -2101,6 +2124,7 @@ void Register_CVehicle(HSQUIRRELVM vm) .Func(_SC("HasOccupant"), &CVehicle::HasOccupant) .Func(_SC("Respawn"), &CVehicle::Respawn) .Func(_SC("Explode"), &CVehicle::Explode) + .Func(_SC("FlattenTyres"), &CVehicle::FlattenTyres) .Func(_SC("SetRot"), &CVehicle::SetRotationEx) .Func(_SC("SetRotation"), &CVehicle::SetRotationEx) .Func(_SC("SetEulerRot"), &CVehicle::SetRotationEulerEx) diff --git a/module/Entity/Vehicle.hpp b/module/Entity/Vehicle.hpp index 053aafa6..f9ef11c2 100644 --- a/module/Entity/Vehicle.hpp +++ b/module/Entity/Vehicle.hpp @@ -262,6 +262,11 @@ public: */ void Explode() const; + /* -------------------------------------------------------------------------------------------- + * Flatten the tyres of the managed vehicle entity. + */ + void FlattenTyres(bool toggle) const; + /* -------------------------------------------------------------------------------------------- * See whether the managed vehicle entity is wrecked. */