Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions resource/menu/client/cl_spectate.lua
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,17 @@ RegisterNetEvent('txcl:spectate:start', function(targetServerId, targetCoords)
redmInstructionGroup = makeRedmInstructionalGroup(keysTable)
end

-- Wait for any ongoing transition to complete before proceeding (#1084)
if isInTransitionState then
stopSpectating()
error('Spectate request received while in transition state')
local attempts = 0
while isInTransitionState and attempts < 100 do
Wait(50)
attempts = attempts + 1
end
if isInTransitionState then
debugPrint('Spectate request timed out waiting for transition state')
return sendSnackbarMessage('error', 'nui_menu.player_modal.actions.interaction.notifications.spectate_failed', true)
end
end

-- check if self-spectate
Expand Down