From e6213d093288af52727c502fe31e64d26fa5f788 Mon Sep 17 00:00:00 2001 From: Sandu Liviu Catalin Date: Mon, 20 Jun 2016 08:08:33 +0300 Subject: [PATCH] Fix the player alpha modification. --- source/Entity/Player.cpp | 12 +++++++++++- source/Entity/Player.hpp | 7 ++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/source/Entity/Player.cpp b/source/Entity/Player.cpp index c5241cf3..325ea99a 100644 --- a/source/Entity/Player.cpp +++ b/source/Entity/Player.cpp @@ -768,7 +768,16 @@ Int32 CPlayer::GetAlpha() const } // ------------------------------------------------------------------------------------------------ -void CPlayer::SetAlpha(Int32 alpha, Int32 fade) const +void CPlayer::SetAlpha(Int32 alpha) const +{ + // Validate the managed identifier + Validate(); + // Perform the requested operation + _Func->SetPlayerAlpha(m_ID, alpha, 0); +} + +// ------------------------------------------------------------------------------------------------ +void CPlayer::SetAlphaEx(Int32 alpha, Int32 fade) const { // Validate the managed identifier Validate(); @@ -2266,6 +2275,7 @@ void Register_CPlayer(HSQUIRRELVM vm) .Func(_SC("SetPos"), &CPlayer::SetPositionEx) .Func(_SC("SetPosition"), &CPlayer::SetPositionEx) .Func(_SC("SetSpeed"), &CPlayer::SetSpeedEx) + .Func(_SC("SetAlpha"), &CPlayer::SetAlphaEx) .Func(_SC("Disembark"), &CPlayer::Disembark) .Func(_SC("SetWeapon"), &CPlayer::SetWeaponEx) .Func(_SC("GiveWeapon"), &CPlayer::GiveWeapon) diff --git a/source/Entity/Player.hpp b/source/Entity/Player.hpp index d66f0645..40d8c5cb 100644 --- a/source/Entity/Player.hpp +++ b/source/Entity/Player.hpp @@ -518,7 +518,12 @@ public: /* -------------------------------------------------------------------------------------------- * Modify the alpha of the managed player entity. */ - void SetAlpha(Int32 alpha, Int32 fade) const; + void SetAlpha(Int32 alpha) const; + + /* -------------------------------------------------------------------------------------------- + * Modify the alpha of the managed player entity. + */ + void SetAlphaEx(Int32 alpha, Int32 fade) const; /* -------------------------------------------------------------------------------------------- * Retrieve the aim position of the managed player entity.