* Fix for group set reloading - thanks @BlueEcko!
This commit is contained in:
Applevangelist 2022-09-20 08:23:49 +02:00
parent a146003a6a
commit 9fedd32e78
2 changed files with 7 additions and 3 deletions

View File

@ -2002,6 +2002,7 @@ function RANGE:OnEventShot( EventData )
self:_DisplayMessageToGroup( _unit, _message, nil, false ) self:_DisplayMessageToGroup( _unit, _message, nil, false )
if self.rangecontrol then if self.rangecontrol then
-- weapon impacted too far from the nearest target! No Score!
self.rangecontrol:NewTransmission( RANGE.Sound.RCWeaponImpactedTooFar.filename, RANGE.Sound.RCWeaponImpactedTooFar.duration, self.soundpath, nil, nil, _message, self.subduration ) self.rangecontrol:NewTransmission( RANGE.Sound.RCWeaponImpactedTooFar.filename, RANGE.Sound.RCWeaponImpactedTooFar.duration, self.soundpath, nil, nil, _message, self.subduration )
end end
@ -2090,6 +2091,7 @@ function RANGE:onafterEnterRange( From, Event, To, player )
local RF = UTILS.Split( string.format( "%.3f", self.rangecontrolfreq ), "." ) local RF = UTILS.Split( string.format( "%.3f", self.rangecontrolfreq ), "." )
-- Radio message that player entered the range -- Radio message that player entered the range
-- You entered the bombing range. For hit assessment, contact the range controller.
self.instructor:NewTransmission( RANGE.Sound.IREnterRange.filename, RANGE.Sound.IREnterRange.duration, self.soundpath ) self.instructor:NewTransmission( RANGE.Sound.IREnterRange.filename, RANGE.Sound.IREnterRange.duration, self.soundpath )
self.instructor:Number2Transmission( RF[1] ) self.instructor:Number2Transmission( RF[1] )
if tonumber( RF[2] ) > 0 then if tonumber( RF[2] ) > 0 then
@ -2110,6 +2112,7 @@ end
function RANGE:onafterExitRange( From, Event, To, player ) function RANGE:onafterExitRange( From, Event, To, player )
if self.instructor then if self.instructor then
-- You left the bombing range zone. Have a nice day!
self.instructor:NewTransmission( RANGE.Sound.IRExitRange.filename, RANGE.Sound.IRExitRange.duration, self.soundpath ) self.instructor:NewTransmission( RANGE.Sound.IRExitRange.filename, RANGE.Sound.IRExitRange.duration, self.soundpath )
end end
@ -3043,6 +3046,7 @@ function RANGE:_CheckInZone( _unitName )
self:_DisplayMessageToGroup( _unit, _msg, nil, true ) self:_DisplayMessageToGroup( _unit, _msg, nil, true )
if self.rangecontrol then if self.rangecontrol then
-- You left the strafing zone too quickly! No score!
self.rangecontrol:NewTransmission( RANGE.Sound.RCLeftStrafePitTooQuickly.filename, RANGE.Sound.RCLeftStrafePitTooQuickly.duration, self.soundpath ) self.rangecontrol:NewTransmission( RANGE.Sound.RCLeftStrafePitTooQuickly.filename, RANGE.Sound.RCLeftStrafePitTooQuickly.duration, self.soundpath )
end end

View File

@ -2306,7 +2306,7 @@ end
-- @param #string Filename The name of the file. -- @param #string Filename The name of the file.
-- @param #boolean Spawn If set to false, do not re-spawn the groups loaded in location and reduce to size. -- @param #boolean Spawn If set to false, do not re-spawn the groups loaded in location and reduce to size.
-- @return Core.Set#SET_GROUP Set of GROUP objects. -- @return Core.Set#SET_GROUP Set of GROUP objects.
-- Returns nil when file cannot be read. Returns a table of data entries if Spawn is false: `{ groupname=groupname, size=size, coordinate=coordinate }` -- Returns nil when file cannot be read. Returns a table of data entries if Spawn is false: `{ groupname=groupname, size=size, coordinate=coordinate, template=template }`
function UTILS.LoadSetOfGroups(Path,Filename,Spawn) function UTILS.LoadSetOfGroups(Path,Filename,Spawn)
local spawn = true local spawn = true
if Spawn == false then spawn = false end if Spawn == false then spawn = false end
@ -2329,10 +2329,10 @@ function UTILS.LoadSetOfGroups(Path,Filename,Spawn)
local posz = tonumber(dataset[6]) local posz = tonumber(dataset[6])
local coordinate = COORDINATE:NewFromVec3({x=posx, y=posy, z=posz}) local coordinate = COORDINATE:NewFromVec3({x=posx, y=posy, z=posz})
local group=nil local group=nil
local data = { groupname=groupname, size=size, coordinate=coordinate } local data = { groupname=groupname, size=size, coordinate=coordinate, template=template }
table.insert(datatable,data) table.insert(datatable,data)
if spawn then if spawn then
local group = SPAWN:New(groupname) local group = SPAWN:New(template)
:InitDelayOff() :InitDelayOff()
:OnSpawnGroup( :OnSpawnGroup(
function(spwndgrp) function(spwndgrp)