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,12 +184,16 @@ function RADAR:BackupData()
self:SetBackupOMData( data.om )
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
for ant in UTIL:Values( { "front", "rear" } ) do
if ( self:GetBackupAntennaData( ant ) == nil ) then
self:SetBackupAntennaData( ant, data[ant] )
end
end
end
end
-- Backs up the local radar data and then replaces it with the data provided by the driver