feat(sync): only trigger sync on enter if passenger view allowed

This commit is contained in:
Dan
2021-03-19 14:08:23 +00:00
parent 989d4050b1
commit 338f3bb243
2 changed files with 12 additions and 14 deletions

View File

@@ -111,7 +111,7 @@ end )
Citizen.CreateThread( function() Citizen.CreateThread( function()
while ( true ) do while ( true ) do
-- The sync trigger should only start when the player is getting into a vehicle -- The sync trigger should only start when the player is getting into a vehicle
if ( IsPedGettingIntoAVehicle( PLY.ped ) ) then if ( IsPedGettingIntoAVehicle( PLY.ped ) and RADAR:IsPassengerViewAllowed() ) then
-- Get the vehicle the player is entering -- Get the vehicle the player is entering
local vehEntering = GetVehiclePedIsEntering( PLY.ped ) local vehEntering = GetVehiclePedIsEntering( PLY.ped )

View File

@@ -349,7 +349,6 @@ function SYNC:SyncDataOnEnter()
-- Make sure passenger view is allowed, also, using PLY:IsPassenger() already checks that the player's -- Make sure passenger view is allowed, also, using PLY:IsPassenger() already checks that the player's
-- vehicle meets the requirements of what the radar requires. This way we don't have to do additional -- vehicle meets the requirements of what the radar requires. This way we don't have to do additional
-- checks manually. -- checks manually.
if ( RADAR:IsPassengerViewAllowed() ) then
if ( PLY:IsPassenger() ) then if ( PLY:IsPassenger() ) then
local driver = PLY:GetOtherPedServerId() local driver = PLY:GetOtherPedServerId()
@@ -364,7 +363,6 @@ function SYNC:SyncDataOnEnter()
READER:RestoreFromBackup() READER:RestoreFromBackup()
end end
end end
end
end end