mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2024-11-08 08:47:17 +01:00
Add a helper member function to the vehicle class to fix the managed vehicle.
This commit is contained in:
parent
4e05d3d285
commit
1d5b12f11f
@ -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)
|
||||
|
@ -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.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user