Fixed speeds being locked when they shouldn't be

This commit is contained in:
Dan
2019-12-10 00:37:55 +00:00
parent b14953bb2a
commit 7558675210

View File

@@ -833,6 +833,8 @@ 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 )
-- Only lock a speed if the antenna is on and the UI is displayed
if ( self:IsPowerOn() and self:GetDisplayState() and not self:GetDisplayHidden() ) then
-- Check if the antenna already has a speed locked, if it does then reset the lock, otherwise we lock
-- a speed
if ( self:IsAntennaSpeedLocked( ant ) ) then
@@ -863,6 +865,7 @@ function RADAR:LockAntennaSpeed( ant )
-- Send an NUI message to change the lock label, otherwise we'd have to wait until the next main loop
SendNUIMessage( { _type = "antennaLock", ant = ant, state = self:IsAntennaSpeedLocked( ant ) } )
end
end
-- Resets an antenna, used when the system is turned off
function RADAR:ResetAntenna( ant )
@@ -1006,7 +1009,10 @@ end
----------------------------------------------------------------------------------]]--
-- Takes a GTA speed and converts it into the type defined by the user in the operator menu
function RADAR:GetVehSpeedFormatted( speed )
-- Get the speed unit from the settings
local unit = self:GetSettingValue( "speedType" )
--
return UTIL:Round( speed * self.speedConversions[unit], 0 )
end