From 88b58592134bb2aabff0f65af9ab7cfbd975f175 Mon Sep 17 00:00:00 2001 From: Sandu Liviu Catalin Date: Thu, 28 Jun 2018 22:12:05 +0300 Subject: [PATCH] Expose the vehicle light data modification API. --- source/Entity/Vehicle.cpp | 19 +++++++++++++++++++ source/Entity/Vehicle.hpp | 10 ++++++++++ 2 files changed, 29 insertions(+) diff --git a/source/Entity/Vehicle.cpp b/source/Entity/Vehicle.cpp index 52217a38..e62e7ae1 100644 --- a/source/Entity/Vehicle.cpp +++ b/source/Entity/Vehicle.cpp @@ -1098,6 +1098,24 @@ void CVehicle::ResetHandlings() const _Func->ResetInstHandling(m_ID); } +// ------------------------------------------------------------------------------------------------ +Int32 CVehicle::GetLightsData() const +{ + // Validate the managed identifier + Validate(); + // Retrieve the requested data + return _Func->GetVehicleLightsData(m_ID); +} + +// ------------------------------------------------------------------------------------------------ +void CVehicle::SetLightsData(Int32 data) const +{ + // Validate the managed identifier + Validate(); + // Apply the requested data + _Func->SetVehicleLightsData(m_ID, data); +} + // ------------------------------------------------------------------------------------------------ bool CVehicle::Embark(CPlayer & player) const { @@ -1950,6 +1968,7 @@ void Register_CVehicle(HSQUIRRELVM vm) .Prop(_SC("HorizontalTurretRotation"), &CVehicle::GetHorizontalTurretRotation) .Prop(_SC("VerTurretRotation"), &CVehicle::GetVerticalTurretRotation) .Prop(_SC("VerticalTurretRotation"), &CVehicle::GetVerticalTurretRotation) + .Prop(_SC("LightsData"), &CVehicle::GetLightsData, &CVehicle::SetLightsData) .Prop(_SC("CollideAreas"), &CVehicle::GetCollideAreas, &CVehicle::SetCollideAreas) .Prop(_SC("TrackPosition"), &CVehicle::GetTrackPosition, &CVehicle::SetTrackPosition) .Prop(_SC("TrackRotation"), &CVehicle::GetTrackRotation, &CVehicle::SetTrackRotation) diff --git a/source/Entity/Vehicle.hpp b/source/Entity/Vehicle.hpp index f7e93855..e3fdbbf5 100644 --- a/source/Entity/Vehicle.hpp +++ b/source/Entity/Vehicle.hpp @@ -602,6 +602,16 @@ public: */ void ResetHandlings() const; + /* -------------------------------------------------------------------------------------------- + * Retrieve the lights data for the managed vehicle entity. + */ + Int32 GetLightsData() const; + + /* -------------------------------------------------------------------------------------------- + * Modify the lights data for the managed vehicle entity. + */ + void SetLightsData(Int32 data) const; + /* -------------------------------------------------------------------------------------------- * Embark the specified player entity into the managed vehicle entity. */