feat: only backup radar antenna data if the power is already on

This commit is contained in:
Dan
2021-03-18 15:39:12 +00:00
parent 9b6279fd5f
commit 984d2221cd

View File

@@ -184,6 +184,9 @@ function RADAR:BackupData()
self:SetBackupOMData( data.om ) self:SetBackupOMData( data.om )
end end
-- Only backup the radar data if the player has the power on. There's no point backing up the data as it'll just
-- get reset when they turn the power on anyway
if ( data.power ) then
-- Backup front and rear antenna data -- Backup front and rear antenna data
for ant in UTIL:Values( { "front", "rear" } ) do for ant in UTIL:Values( { "front", "rear" } ) do
if ( self:GetBackupAntennaData( ant ) == nil ) then if ( self:GetBackupAntennaData( ant ) == nil ) then
@@ -191,6 +194,7 @@ function RADAR:BackupData()
end end
end end
end end
end
-- Backs up the local radar data and then replaces it with the data provided by the driver -- Backs up the local radar data and then replaces it with the data provided by the driver
function RADAR:LoadDataFromDriver( data ) function RADAR:LoadDataFromDriver( data )