Min Fuel Fixes

AI_A2A and AI_Patrol:
Changed average fuel for controllable to new min fuel function. Hopefully provides better RTB behavior.

CONTROLLABLE:
Added GetFuelMin and GetFuelAve functions to ensure polymorphic behavior.

UNIT:
Added GetFuelMin and GetFuelAve functions for completeness and potential polymorphism.
This commit is contained in:
funkyfranky
2018-06-18 23:13:21 +02:00
parent 99963c28e9
commit 19197bf234
4 changed files with 42 additions and 4 deletions

View File

@@ -259,6 +259,26 @@ function CONTROLLABLE:GetLife0()
return nil
end
--- Returns relative minimum amount of fuel (from 0.0 to 1.0) a unit or group has in its internal tanks.
-- This method returns nil to ensure polymorphic behaviour! This method needs to be overridden by GROUP or UNIT.
-- @param #CONTROLLABLE self
-- @return #nil The CONTROLLABLE is not existing or alive.
function CONTROLLABLE:GetFuelMin()
self:F( self.ControllableName )
return nil
end
--- Returns relative average amount of fuel (from 0.0 to 1.0) a unit or group has in its internal tanks.
-- This method returns nil to ensure polymorphic behaviour! This method needs to be overridden by GROUP or UNIT.
-- @param #CONTROLLABLE self
-- @return #nil The CONTROLLABLE is not existing or alive.
function CONTROLLABLE:GetFuelAve()
self:F( self.ControllableName )
return nil
end
--- Returns relative amount of fuel (from 0.0 to 1.0) the unit has in its internal tanks.
-- This method returns nil to ensure polymorphic behaviour! This method needs to be overridden by GROUP or UNIT.
-- @param #CONTROLLABLE self
@@ -270,8 +290,6 @@ function CONTROLLABLE:GetFuel()
end
-- Tasks
--- Clear all tasks from the controllable.