Update Controllable.lua

Added control to keep within limits of the options
This commit is contained in:
Applevangelist 2020-11-22 13:01:26 +01:00 committed by GitHub
parent 9573d92cc0
commit 3e0db05664
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3670,6 +3670,9 @@ function CONTROLLABLE:OptionAAAttackRange(range)
self:F2( { self.ControllableName } )
-- defaults to 3
local range = range or 3
if range < 0 or range > 4 then
range = 3
end
local DCSControllable = self:GetDCSObject()
if DCSControllable then
local Controller = self:_GetController()