Merge remote-tracking branch 'origin/master' into develop

This commit is contained in:
Applevangelist 2023-11-16 16:11:20 +01:00
commit f453619c78

View File

@ -105,6 +105,7 @@
-- @field Sound.SRS#MSRSQUEUE controlsrsQ SRS queue for range controller.
-- @field Sound.SRS#MSRS instructmsrs SRS wrapper for range instructor.
-- @field Sound.SRS#MSRSQUEUE instructsrsQ SRS queue for range instructor.
-- @field #number Coalition Coalition side for the menu, if any.
-- @extends Core.Fsm#FSM
--- *Don't only practice your art, but force your way into its secrets; art deserves that, for it and knowledge can raise man to the Divine.* - Ludwig van Beethoven
@ -355,7 +356,8 @@ RANGE = {
targetsheet = nil,
targetpath = nil,
targetprefix = nil,
}
Coalition = nil,
}
--- Default range parameters.
-- @type RANGE.Defaults
@ -591,7 +593,7 @@ RANGE.MenuF10Root = nil
--- Range script version.
-- @field #string version
RANGE.version = "2.7.1"
RANGE.version = "2.7.3"
-- TODO list:
-- TODO: Verbosity level for messages.
@ -613,8 +615,9 @@ RANGE.version = "2.7.1"
--- RANGE contructor. Creates a new RANGE object.
-- @param #RANGE self
-- @param #string RangeName Name of the range. Has to be unique. Will we used to create F10 menu items etc.
-- @param #number Coalition (optional) Coalition of the range, if any, e.g. coalition.side.BLUE.
-- @return #RANGE RANGE object.
function RANGE:New( RangeName )
function RANGE:New( RangeName, Coalition )
-- Inherit BASE.
local self = BASE:Inherit( self, FSM:New() ) -- #RANGE
@ -623,6 +626,8 @@ function RANGE:New( RangeName )
-- TODO: make sure that the range name is not given twice. This would lead to problems in the F10 radio menu.
self.rangename = RangeName or "Practice Range"
self.Coalition = Coalition
-- Log id.
self.lid = string.format( "RANGE %s | ", self.rangename )
@ -1746,8 +1751,14 @@ function RANGE:OnEventBirth( EventData )
-- Reset current strafe status.
self.strafeStatus[_uid] = nil
-- Add Menu commands after a delay of 0.1 seconds.
self:ScheduleOnce( 0.1, self._AddF10Commands, self, _unitName )
if self.Coalition then
if EventData.IniCoalition == self.Coalition then
self:ScheduleOnce( 0.1, self._AddF10Commands, self, _unitName )
end
else
-- Add Menu commands after a delay of 0.1 seconds.
self:ScheduleOnce( 0.1, self._AddF10Commands, self, _unitName )
end
-- By default, some bomb impact points and do not flare each hit on target.
self.PlayerSettings[_playername] = {} -- #RANGE.PlayerData