mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
Removed completely routines.scheduleFunction
This commit is contained in:
@@ -887,7 +887,6 @@ function CARGO_PACKAGE:OnBoard( Client, LandingZone, OnBoardSide )
|
||||
end
|
||||
self:T( "Routing " .. CargoHostName )
|
||||
|
||||
--routines.scheduleFunction( routines.goRoute, { CargoHostName, Points}, timer.getTime() + 4 )
|
||||
SCHEDULER:New( self, routines.goRoute, { CargoHostName, Points }, 4 )
|
||||
|
||||
return Valid
|
||||
|
||||
@@ -43,7 +43,6 @@ function CLEANUP:New( ZoneNames, TimeInterval ) local self = BASE:Inherit( self,
|
||||
|
||||
_EVENTDISPATCHER:OnBirth( self._OnEventBirth, self )
|
||||
|
||||
--self.CleanUpScheduler = routines.scheduleFunction( self._CleanUpScheduler, { self }, timer.getTime() + 1, TimeInterval )
|
||||
self.CleanUpScheduler = SCHEDULER:New( self, self._CleanUpScheduler, {}, 1, TimeInterval )
|
||||
|
||||
return self
|
||||
@@ -168,7 +167,6 @@ function CLEANUP:_EventShot( Event )
|
||||
if ( CurrentLandingZoneID ) then
|
||||
-- Okay, the missile was fired within the CLEANUP.ZoneNames, destroy the fired weapon.
|
||||
--_SEADmissile:destroy()
|
||||
--routines.scheduleFunction( CLEANUP._DestroyMissile, { self, Event.Weapon }, timer.getTime() + 0.1)
|
||||
SCHEDULER:New( self, CLEANUP._DestroyMissile, { Event.Weapon }, 0.1 )
|
||||
end
|
||||
end
|
||||
@@ -185,7 +183,6 @@ function CLEANUP:_EventHitCleanUp( Event )
|
||||
self:T( { "Life: ", Event.IniDCSUnitName, ' = ', Event.IniDCSUnit:getLife(), "/", Event.IniDCSUnit:getLife0() } )
|
||||
if Event.IniDCSUnit:getLife() < Event.IniDCSUnit:getLife0() then
|
||||
self:T( "CleanUp: Destroy: " .. Event.IniDCSUnitName )
|
||||
--routines.scheduleFunction( CLEANUP._DestroyUnit, { self, Event.IniDCSUnit }, timer.getTime() + 0.1)
|
||||
SCHEDULER:New( self, CLEANUP._DestroyUnit, { Event.IniDCSUnit }, 0.1 )
|
||||
end
|
||||
end
|
||||
@@ -196,7 +193,6 @@ function CLEANUP:_EventHitCleanUp( Event )
|
||||
self:T( { "Life: ", Event.TgtDCSUnitName, ' = ', Event.TgtDCSUnit:getLife(), "/", Event.TgtDCSUnit:getLife0() } )
|
||||
if Event.TgtDCSUnit:getLife() < Event.TgtDCSUnit:getLife0() then
|
||||
self:T( "CleanUp: Destroy: " .. Event.TgtDCSUnitName )
|
||||
--routines.scheduleFunction( CLEANUP._DestroyUnit, { self, Event.TgtDCSUnit }, timer.getTime() + 0.1 )
|
||||
SCHEDULER:New( self, CLEANUP._DestroyUnit, { Event.TgtDCSUnit }, 0.1 )
|
||||
end
|
||||
end
|
||||
|
||||
@@ -202,7 +202,6 @@ function CONTROLLABLE:PushTask( DCSTask, WaitTime )
|
||||
-- Controller:pushTask( DCSTask )
|
||||
|
||||
if WaitTime then
|
||||
--routines.scheduleFunction( Controller.pushTask, { Controller, DCSTask }, timer.getTime() + WaitTime )
|
||||
SCHEDULER:New( Controller, Controller.pushTask, { DCSTask }, WaitTime )
|
||||
else
|
||||
Controller:pushTask( DCSTask )
|
||||
@@ -233,7 +232,6 @@ function CONTROLLABLE:SetTask( DCSTask, WaitTime )
|
||||
if not WaitTime then
|
||||
WaitTime = 1
|
||||
end
|
||||
--routines.scheduleFunction( Controller.setTask, { Controller, DCSTask }, timer.getTime() + WaitTime )
|
||||
SCHEDULER:New( Controller, Controller.setTask, { DCSTask }, WaitTime )
|
||||
|
||||
return self
|
||||
@@ -1481,7 +1479,6 @@ function CONTROLLABLE:Route( GoPoints )
|
||||
local MissionTask = { id = 'Mission', params = { route = { points = Points, }, }, }
|
||||
local Controller = self:_GetController()
|
||||
--Controller.setTask( Controller, MissionTask )
|
||||
--routines.scheduleFunction( Controller.setTask, { Controller, MissionTask}, timer.getTime() + 1 )
|
||||
SCHEDULER:New( Controller, Controller.setTask, { MissionTask }, 1 )
|
||||
return self
|
||||
end
|
||||
|
||||
@@ -557,7 +557,6 @@ function ESCORT:MenuReportTargets( Seconds )
|
||||
self.EscortMenuAttackNearbyTargets = MENU_CLIENT:New( self.EscortClient, "Attack targets", self.EscortMenu )
|
||||
|
||||
|
||||
--self.ReportTargetsScheduler = routines.scheduleFunction( self._ReportTargetsScheduler, { self }, timer.getTime() + 1, Seconds )
|
||||
self.ReportTargetsScheduler = SCHEDULER:New( self, self._ReportTargetsScheduler, {}, 1, Seconds )
|
||||
|
||||
return self
|
||||
@@ -779,7 +778,6 @@ function ESCORT._SwitchReportNearbyTargets( MenuParam )
|
||||
|
||||
if self.ReportTargets then
|
||||
if not self.ReportTargetsScheduler then
|
||||
--self.ReportTargetsScheduler = routines.scheduleFunction( self._ReportTargetsScheduler, { self }, timer.getTime() + 1, 30 )
|
||||
self.ReportTargetsScheduler = SCHEDULER:New( self, self._ReportTargetsScheduler, {}, 1, 30 )
|
||||
end
|
||||
else
|
||||
@@ -856,16 +854,6 @@ function ESCORT._AttackTarget( MenuParam )
|
||||
EscortGroup:OptionROEOpenFire()
|
||||
EscortGroup:OptionROTPassiveDefense()
|
||||
EscortGroup:SetState( EscortGroup, "Escort", self )
|
||||
-- routines.scheduleFunction(
|
||||
-- EscortGroup.PushTask,
|
||||
-- { EscortGroup,
|
||||
-- EscortGroup:TaskCombo(
|
||||
-- { EscortGroup:TaskAttackUnit( AttackUnit ),
|
||||
-- EscortGroup:TaskFunction( 1, 2, "_Resume", {"''"} )
|
||||
-- }
|
||||
-- )
|
||||
-- }, timer.getTime() + 10
|
||||
-- )
|
||||
SCHEDULER:New( EscortGroup,
|
||||
EscortGroup.PushTask,
|
||||
{ EscortGroup:TaskCombo(
|
||||
@@ -876,15 +864,6 @@ function ESCORT._AttackTarget( MenuParam )
|
||||
}, 10
|
||||
)
|
||||
else
|
||||
-- routines.scheduleFunction(
|
||||
-- EscortGroup.PushTask,
|
||||
-- { EscortGroup,
|
||||
-- EscortGroup:TaskCombo(
|
||||
-- { EscortGroup:TaskFireAtPoint( AttackUnit:GetPointVec2(), 50 )
|
||||
-- }
|
||||
-- )
|
||||
-- }, timer.getTime() + 10
|
||||
-- )
|
||||
SCHEDULER:New( EscortGroup,
|
||||
EscortGroup.PushTask,
|
||||
{ EscortGroup:TaskCombo(
|
||||
@@ -915,16 +894,6 @@ function ESCORT._AssistTarget( MenuParam )
|
||||
if EscortGroupAttack:IsAir() then
|
||||
EscortGroupAttack:OptionROEOpenFire()
|
||||
EscortGroupAttack:OptionROTVertical()
|
||||
-- routines.scheduleFunction(
|
||||
-- EscortGroupAttack.PushTask,
|
||||
-- { EscortGroupAttack,
|
||||
-- EscortGroupAttack:TaskCombo(
|
||||
-- { EscortGroupAttack:TaskAttackUnit( AttackUnit ),
|
||||
-- EscortGroupAttack:TaskOrbitCircle( 500, 350 )
|
||||
-- }
|
||||
-- )
|
||||
-- }, timer.getTime() + 10
|
||||
-- )
|
||||
SCHDULER:New( EscortGroupAttack,
|
||||
EscortGroupAttack.PushTask,
|
||||
{ EscortGroupAttack:TaskCombo(
|
||||
@@ -935,15 +904,6 @@ function ESCORT._AssistTarget( MenuParam )
|
||||
}, 10
|
||||
)
|
||||
else
|
||||
-- routines.scheduleFunction(
|
||||
-- EscortGroupAttack.PushTask,
|
||||
-- { EscortGroupAttack,
|
||||
-- EscortGroupAttack:TaskCombo(
|
||||
-- { EscortGroupAttack:TaskFireAtPoint( AttackUnit:GetPointVec2(), 50 )
|
||||
-- }
|
||||
-- )
|
||||
-- }, timer.getTime() + 10
|
||||
-- )
|
||||
SCHEDULER:New( EscortGroupAttack,
|
||||
EscortGroupAttack.PushTask,
|
||||
{ EscortGroupAttack:TaskCombo(
|
||||
@@ -1003,7 +963,6 @@ function ESCORT._ResumeMission( MenuParam )
|
||||
table.remove( WayPoints, 1 )
|
||||
end
|
||||
|
||||
--routines.scheduleFunction( EscortGroup.SetTask, {EscortGroup, EscortGroup:TaskRoute( WayPoints ) }, timer.getTime() + 1 )
|
||||
SCHEDULER:New( EscortGroup, EscortGroup.SetTask, { EscortGroup:TaskRoute( WayPoints ) }, 1 )
|
||||
|
||||
EscortGroup:MessageToClient( "Resuming mission from waypoint " .. WayPoint .. ".", 10, EscortClient )
|
||||
|
||||
@@ -441,22 +441,6 @@ routines.getNorthCorrection = function(point) --gets the correction needed for
|
||||
end
|
||||
|
||||
|
||||
-- the main area
|
||||
do
|
||||
-- THE MAIN FUNCTION -- Accessed 100 times/sec.
|
||||
routines.main = function()
|
||||
timer.scheduleFunction(routines.main, {}, timer.getTime() + 2) --reschedule first in case of Lua error
|
||||
----------------------------------------------------------------------------------------------------------
|
||||
--area to add new stuff in
|
||||
|
||||
routines.do_scheduled_functions()
|
||||
end -- end of routines.main
|
||||
|
||||
timer.scheduleFunction(routines.main, {}, timer.getTime() + 2)
|
||||
|
||||
end
|
||||
|
||||
|
||||
do
|
||||
local idNum = 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user