mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-07-03 07:27:11 +02:00
Return null entity instances instead of null for the functions that need to return an entity instance.
Finally fix the player unspectating bug and introduce a new event for when a player spectates none. Update the global functions that check for player existance to use the new implementation.
This commit is contained in:
@ -676,7 +676,14 @@ static void OnPlayerSpectate(int32_t player_id, int32_t target_player_id)
|
||||
// Attempt to forward the event
|
||||
try
|
||||
{
|
||||
Core::Get().EmitPlayerSpectate(player_id, target_player_id);
|
||||
if (target_player_id < 0)
|
||||
{
|
||||
Core::Get().EmitPlayerUnspectate(player_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
Core::Get().EmitPlayerSpectate(player_id, target_player_id);
|
||||
}
|
||||
}
|
||||
SQMOD_CATCH_EVENT_EXCEPTION(OnPlayerSpectate)
|
||||
// See if a reload was requested
|
||||
|
Reference in New Issue
Block a user