diff --git a/source/Entity/Vehicle.cpp b/source/Entity/Vehicle.cpp index fa912b13..be9c4b50 100644 --- a/source/Entity/Vehicle.cpp +++ b/source/Entity/Vehicle.cpp @@ -737,6 +737,16 @@ void CVehicle::SetHealth(Float32 amount) const _Func->SetVehicleHealth(m_ID, amount); } +// ------------------------------------------------------------------------------------------------ +void CVehicle::Fix() const +{ + // Validate the managed identifier + Validate(); + // Perform the requested operation + _Func->SetVehicleHealth(m_ID, 1000); + _Func->SetVehicleDamageData(m_ID, 0); +} + // ------------------------------------------------------------------------------------------------ Int32 CVehicle::GetPrimaryColor() const { @@ -1734,6 +1744,7 @@ void Register_CVehicle(HSQUIRRELVM vm) .Func(_SC("SetSpawnRotation"), &CVehicle::SetSpawnRotationEx) .Func(_SC("SetSpawnEulerRot"), &CVehicle::SetSpawnRotationEulerEx) .Func(_SC("SetSpawnEulerRotation"), &CVehicle::SetSpawnRotationEulerEx) + .Func(_SC("Fix"), &CVehicle::Fix) .Func(_SC("SetColors"), &CVehicle::SetColors) .Func(_SC("GetPartStatus"), &CVehicle::GetPartStatus) .Func(_SC("SetPartStatus"), &CVehicle::SetPartStatus) diff --git a/source/Entity/Vehicle.hpp b/source/Entity/Vehicle.hpp index 36530119..b139c985 100644 --- a/source/Entity/Vehicle.hpp +++ b/source/Entity/Vehicle.hpp @@ -475,6 +475,11 @@ public: */ void SetHealth(Float32 amount) const; + /* -------------------------------------------------------------------------------------------- + * Fix the damage and restore health for the managed vehicle entity. + */ + void Fix() const; + /* -------------------------------------------------------------------------------------------- * Retrieve the primary color of the managed vehicle entity. */