From a65a5b4cbf30719480646e1393149a1765092b89 Mon Sep 17 00:00:00 2001 From: Dan Date: Sat, 13 Mar 2021 15:02:38 +0000 Subject: [PATCH] fix: requesting radar data when there's no driver --- cl_sync.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cl_sync.lua b/cl_sync.lua index 9a8bf8f..aec5c75 100644 --- a/cl_sync.lua +++ b/cl_sync.lua @@ -89,7 +89,11 @@ function SYNC:SyncDataOnEnter() if ( PLY:IsPassenger() ) then -- UTIL:Notify( "Triggering server event to get radar data" ) local driver = PLY:GetOtherPedServerId() - TriggerServerEvent( "wk_wars2x_sync:requestRadarData", driver ) + + -- Only trigger the event if there is actually a driver + if ( driver ~= nil ) then + TriggerServerEvent( "wk_wars2x_sync:requestRadarData", driver ) + end elseif ( PLY:IsDriver() ) then -- UTIL:Notify( "Restoring local radar data" )