1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2024-11-08 08:47:17 +01:00

Improve the SetAnimation method on player class.

Make it so that the animation group is optional.
This commit is contained in:
Sandu Liviu Catalin 2016-06-15 06:06:03 +03:00
parent 7391d9391e
commit ef41d0d243
2 changed files with 20 additions and 4 deletions

View File

@ -1075,7 +1075,16 @@ bool CPlayer::IsCameraLocked() const
}
// ------------------------------------------------------------------------------------------------
void CPlayer::SetAnimation(Int32 group, Int32 anim) const
void CPlayer::SetAnimation(Int32 anim) const
{
// Validate the managed identifier
Validate();
// Perform the requested operation
_Func->SetPlayerAnimation(m_ID, 0, anim);
}
// ------------------------------------------------------------------------------------------------
void CPlayer::SetAnimation(Int32 anim, Int32 group) const
{
// Validate the managed identifier
Validate();
@ -2166,8 +2175,6 @@ void Register_CPlayer(HSQUIRRELVM vm)
.Func(_SC("RemoveWeapon"), &CPlayer::RemoveWeapon)
.Func(_SC("StripWeapons"), &CPlayer::StripWeapons)
.Func(_SC("RestoreCamera"), &CPlayer::RestoreCamera)
.Func(_SC("SetAnim"), &CPlayer::SetAnimation)
.Func(_SC("Animation"), &CPlayer::SetAnimation)
.Func(_SC("Spectating"), &CPlayer::GetSpectator)
.Func(_SC("Spectate"), &CPlayer::SetSpectator)
.Func(_SC("Redirect"), &CPlayer::Redirect)
@ -2198,6 +2205,10 @@ void Register_CPlayer(HSQUIRRELVM vm)
(_SC("StartStream"), &CPlayer::StartStream)
.Overload< void (CPlayer::*)(Uint32) >
(_SC("StartStream"), &CPlayer::StartStream)
.Overload< void (CPlayer::*)(Int32) const >
(_SC("SetAnimation"), &CPlayer::SetAnimation)
.Overload< void (CPlayer::*)(Int32, Int32) const >
(_SC("SetAnimation"), &CPlayer::SetAnimation)
// Raw Squirrel Methods
.SquirrelFunc(_SC("Msg"), &CPlayer::Msg)
.SquirrelFunc(_SC("MsgP"), &CPlayer::MsgP)

View File

@ -663,7 +663,12 @@ public:
/* --------------------------------------------------------------------------------------------
* Modify the animation of the managed player entity.
*/
void SetAnimation(Int32 group, Int32 anim) const;
void SetAnimation(Int32 anim) const;
/* --------------------------------------------------------------------------------------------
* Modify the animation of the managed player entity.
*/
void SetAnimation(Int32 anim, Int32 group) const;
/* --------------------------------------------------------------------------------------------
* Retrieve the vehicle that the managed player entity is standing on.