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:
parent
2a4f4853ea
commit
9c1cefab37
@ -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();
|
||||
// Perform the requested operation
|
||||
_Func->SetPlayerSpectateTarget(m_ID, target.GetID());
|
||||
// See if the given target is null
|
||||
if (target == nullptr)
|
||||
{
|
||||
// Spectate an invalid player
|
||||
_Func->SetPlayerSpectateTarget(m_ID, -1);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Spectate the given target
|
||||
_Func->SetPlayerSpectateTarget(m_ID, target->GetID());
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
|
@ -727,7 +727,7 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* 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.
|
||||
|
Loading…
Reference in New Issue
Block a user