mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Updates
This commit is contained in:
@@ -727,14 +727,17 @@ do -- FSM
|
||||
if DelaySeconds ~= nil then
|
||||
if DelaySeconds < 0 then -- Only call the event ONCE!
|
||||
DelaySeconds = math.abs( DelaySeconds )
|
||||
if not self._EventSchedules[EventName] then
|
||||
if not self._EventSchedules[EventName] then
|
||||
CallID = self.CallScheduler:Schedule( self, self._handler, { EventName, ... }, DelaySeconds or 1, nil, nil, nil, 4, true )
|
||||
self._EventSchedules[EventName] = CallID
|
||||
self:T2(string.format("NEGATIVE Event %s delayed by %.1f sec SCHEDULED with CallID=%s", EventName, DelaySeconds, tostring(CallID)))
|
||||
else
|
||||
self:T2(string.format("NEGATIVE Event %s delayed by %.1f sec CANCELLED as we already have such an event in the queue.", EventName, DelaySeconds))
|
||||
-- reschedule
|
||||
end
|
||||
else
|
||||
CallID = self.CallScheduler:Schedule( self, self._handler, { EventName, ... }, DelaySeconds or 1, nil, nil, nil, 4, true )
|
||||
self:T2(string.format("Event %s delayed by %.1f sec SCHEDULED with CallID=%s", EventName, DelaySeconds, tostring(CallID)))
|
||||
end
|
||||
else
|
||||
error( "FSM: An asynchronous event trigger requires a DelaySeconds parameter!!! This can be positive or negative! Sorry, but will not process this." )
|
||||
|
||||
@@ -357,7 +357,7 @@ do -- COORDINATE
|
||||
-- @return #table Table of DCS static objects found.
|
||||
-- @return #table Table of DCS scenery objects found.
|
||||
function COORDINATE:ScanObjects(radius, scanunits, scanstatics, scanscenery)
|
||||
self:F(string.format("Scanning in radius %.1f m.", radius))
|
||||
self:F(string.format("Scanning in radius %.1f m.", radius or 100))
|
||||
|
||||
local SphereSearch = {
|
||||
id = world.VolumeType.SPHERE,
|
||||
@@ -437,9 +437,11 @@ do -- COORDINATE
|
||||
end
|
||||
for _,static in pairs(Statics) do
|
||||
self:T(string.format("Scan found static %s", static:getName()))
|
||||
_DATABASE:AddStatic(static:getName())
|
||||
end
|
||||
for _,scenery in pairs(Scenery) do
|
||||
self:T(string.format("Scan found scenery %s", scenery:getTypeName()))
|
||||
self:T(string.format("Scan found scenery %s typename=%s", scenery:getName(), scenery:getTypeName()))
|
||||
SCENERY:Register(scenery:getName(), scenery)
|
||||
end
|
||||
|
||||
return gotunits, gotstatics, gotscenery, Units, Statics, Scenery
|
||||
|
||||
@@ -509,14 +509,17 @@ end
|
||||
-- @param #SPAWN self
|
||||
-- @param #string AirbaseName Name of the airbase.
|
||||
-- @param #number Takeoff (Optional) Takeoff type. Can be SPAWN.Takeoff.Hot (default), SPAWN.Takeoff.Cold or SPAWN.Takeoff.Runway.
|
||||
-- @param #number TerminalTyple (Optional) The terminal type.
|
||||
-- @return #SPAWN self
|
||||
function SPAWN:InitAirbase( AirbaseName, Takeoff )
|
||||
function SPAWN:InitAirbase( AirbaseName, Takeoff, TerminalType )
|
||||
self:F( )
|
||||
|
||||
self.SpawnInitAirbase=AIRBASE:FindByName(AirbaseName)
|
||||
|
||||
self.SpawnInitTakeoff=Takeoff or SPAWN.Takeoff.Hot
|
||||
|
||||
self.SpawnInitTerminalType=TerminalType
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
@@ -1133,7 +1136,7 @@ function SPAWN:Spawn()
|
||||
self:F( { self.SpawnTemplatePrefix, self.SpawnIndex, self.AliveUnits } )
|
||||
|
||||
if self.SpawnInitAirbase then
|
||||
return self:SpawnAtAirbase(self.SpawnInitAirbase, self.SpawnInitTakeoff)
|
||||
return self:SpawnAtAirbase(self.SpawnInitAirbase, self.SpawnInitTakeoff, nil, self.SpawnInitTerminalType)
|
||||
else
|
||||
return self:SpawnWithIndex( self.SpawnIndex + 1 )
|
||||
end
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
do -- UserFlag
|
||||
|
||||
--- @type USERFLAG
|
||||
-- @field #string ClassName Name of the class
|
||||
-- @field #string UserFlagName Name of the flag.
|
||||
-- @extends Core.Base#BASE
|
||||
|
||||
|
||||
@@ -30,7 +32,8 @@ do -- UserFlag
|
||||
--
|
||||
-- @field #USERFLAG
|
||||
USERFLAG = {
|
||||
ClassName = "USERFLAG",
|
||||
ClassName = "USERFLAG",
|
||||
UserFlagName = nil,
|
||||
}
|
||||
|
||||
--- USERFLAG Constructor.
|
||||
@@ -46,6 +49,12 @@ do -- UserFlag
|
||||
return self
|
||||
end
|
||||
|
||||
--- Get the userflag name.
|
||||
-- @param #USERFLAG self
|
||||
-- @return #string Name of the user flag.
|
||||
function USERFLAG:GetName()
|
||||
return self.UserFlagName
|
||||
end
|
||||
|
||||
--- Set the userflag to a given Number.
|
||||
-- @param #USERFLAG self
|
||||
|
||||
Reference in New Issue
Block a user