fix: locked speeds not syncing

This commit is contained in:
Dan
2021-03-13 22:41:54 +00:00
parent 35cd8aeb3b
commit 469166b2ca
2 changed files with 3 additions and 3 deletions

View File

@@ -1341,9 +1341,9 @@ end
-- When the user presses the speed lock key for either antenna, this function is called to get the -- 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 -- 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 -- 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 -- 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 -- reset the lock
if ( not self:IsAntennaSpeedLocked( ant ) ) then if ( not self:IsAntennaSpeedLocked( ant ) ) then

View File

@@ -137,7 +137,7 @@ end )
-- Event for receiving a lock state and speed data for the given antenna -- Event for receiving a lock state and speed data for the given antenna
RegisterNetEvent( "wk_wars2x_sync:receiveLockAntennaSpeed" ) RegisterNetEvent( "wk_wars2x_sync:receiveLockAntennaSpeed" )
AddEventHandler( "wk_wars2x_sync:receiveLockAntennaSpeed", function( antenna, data ) AddEventHandler( "wk_wars2x_sync:receiveLockAntennaSpeed", function( antenna, data )
RADAR:LockAntennaSpeed( antenna, data ) RADAR:LockAntennaSpeed( antenna, data, true )
end ) end )