From 469166b2ca69e3c98562c646d44486aae51069df Mon Sep 17 00:00:00 2001 From: Dan Date: Sat, 13 Mar 2021 22:41:54 +0000 Subject: [PATCH] fix: locked speeds not syncing --- cl_radar.lua | 4 ++-- cl_sync.lua | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cl_radar.lua b/cl_radar.lua index 51d6be7..6d7998e 100644 --- a/cl_radar.lua +++ b/cl_radar.lua @@ -1341,9 +1341,9 @@ end -- When the user presses the speed lock key for either antenna, this function is called to get the -- necessary information from the antenna, and then lock it into the display -function RADAR:LockAntennaSpeed( ant, override ) +function RADAR:LockAntennaSpeed( ant, override, lockRegardless ) -- Only lock a speed if the antenna is on and the UI is displayed - if ( self:IsPowerOn() and self:GetDisplayState() and not self:GetDisplayHidden() and self:IsAntennaTransmitting( ant ) ) then + if ( self:IsPowerOn() and ( ( self:GetDisplayState() and not self:GetDisplayHidden() ) or lockRegardless ) and self:IsAntennaTransmitting( ant ) ) then -- Check if the antenna doesn't have a locked speed, if it doesn't then we lock in the speed, otherwise we -- reset the lock if ( not self:IsAntennaSpeedLocked( ant ) ) then diff --git a/cl_sync.lua b/cl_sync.lua index aec5c75..d2384a2 100644 --- a/cl_sync.lua +++ b/cl_sync.lua @@ -137,7 +137,7 @@ end ) -- Event for receiving a lock state and speed data for the given antenna RegisterNetEvent( "wk_wars2x_sync:receiveLockAntennaSpeed" ) AddEventHandler( "wk_wars2x_sync:receiveLockAntennaSpeed", function( antenna, data ) - RADAR:LockAntennaSpeed( antenna, data ) + RADAR:LockAntennaSpeed( antenna, data, true ) end )