mirror of
https://github.com/Michatec/wk_wars2x.git
synced 2026-04-01 08:26:27 +02:00
fix: locked speeds not syncing
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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 )
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user