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

Possible fix for the spectate player function. Temporary fix.

This commit is contained in:
Sandu Liviu Catalin 2017-02-22 20:46:48 +02:00
parent 2a4f4853ea
commit 9c1cefab37
2 changed files with 13 additions and 4 deletions

View File

@ -1345,12 +1345,21 @@ LightObj & CPlayer::GetSpectator() const
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
void CPlayer::SetSpectator(CPlayer & target) const void CPlayer::SetSpectator(CPlayer * target) const
{ {
// Validate the managed identifier // Validate the managed identifier
Validate(); Validate();
// Perform the requested operation // See if the given target is null
_Func->SetPlayerSpectateTarget(m_ID, target.GetID()); if (target == nullptr)
{
// Spectate an invalid player
_Func->SetPlayerSpectateTarget(m_ID, -1);
}
else
{
// Spectate the given target
_Func->SetPlayerSpectateTarget(m_ID, target->GetID());
}
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------

View File

@ -727,7 +727,7 @@ public:
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Set the managed player entity to spectate the specified player entity. * Set the managed player entity to spectate the specified player entity.
*/ */
void SetSpectator(CPlayer & target) const; void SetSpectator(CPlayer * target) const;
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Redirect the managed player entity to the specified server. * Redirect the managed player entity to the specified server.