From 0eb9d1917b410a0f9a8b403934093a3f835c4fd6 Mon Sep 17 00:00:00 2001 From: FlightControl Date: Thu, 4 May 2017 10:19:34 +0200 Subject: [PATCH] Updates --- Moose Development/Moose/Core/Database.lua | 12 ++++++------ Moose Development/Moose/Core/Menu.lua | 8 ++++---- Moose Development/Moose/Tasking/DetectionManager.lua | 1 + Moose Development/Moose/Tasking/Mission.lua | 2 +- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/Moose Development/Moose/Core/Database.lua b/Moose Development/Moose/Core/Database.lua index 2ce9d7928..e3da3142d 100644 --- a/Moose Development/Moose/Core/Database.lua +++ b/Moose Development/Moose/Core/Database.lua @@ -112,7 +112,7 @@ function DATABASE:New() self.UNITS_Position = 0 - --- @param Wrapper.Unit#UNIT PlayerUnit + --- @param #DATABASE self local function CheckPlayers( self ) local UNITS_Count = #self.UNITS_Index @@ -122,12 +122,12 @@ function DATABASE:New() if PlayerUnit then local UnitName = PlayerUnit:GetName() local PlayerName = PlayerUnit:GetPlayerName() - self:E( { UNITS_Count, self.UNITS_Position, UnitName, PlayerName } ) + --self:E( { UNITS_Count, self.UNITS_Position, UnitName, PlayerName } ) if PlayerName and PlayerName ~= "" then - if not self.PLAYERS[PlayerName] or self.PLAYERS[PlayerName] ~= PlayerUnit then + if self.PLAYERS[PlayerName] == nil or self.PLAYERS[PlayerName] ~= UnitName then self:E( { "Add player for unit:", UnitName, PlayerName } ) self:AddPlayer( UnitName, PlayerName ) - _EVENTDISPATCHER:CreateEventPlayerEnterUnit( PlayerUnit ) + --_EVENTDISPATCHER:CreateEventPlayerEnterUnit( PlayerUnit ) end end end @@ -135,7 +135,7 @@ function DATABASE:New() end self:E( "Scheduling" ) - local PlayerCheckSchedule = SCHEDULER:New( nil, CheckPlayers, { self }, 2, 0.05 ) + local PlayerCheckSchedule = SCHEDULER:New( nil, CheckPlayers, { self }, 2, 0.1 ) return self end @@ -311,7 +311,7 @@ function DATABASE:AddPlayer( UnitName, PlayerName ) if PlayerName then self:E( { "Add player for unit:", UnitName, PlayerName } ) - self.PLAYERS[PlayerName] = self:FindUnit( UnitName ) + self.PLAYERS[PlayerName] = UnitName self.PLAYERSJOINED[PlayerName] = PlayerName end end diff --git a/Moose Development/Moose/Core/Menu.lua b/Moose Development/Moose/Core/Menu.lua index 7a6049091..2188db052 100644 --- a/Moose Development/Moose/Core/Menu.lua +++ b/Moose Development/Moose/Core/Menu.lua @@ -780,9 +780,9 @@ do self = MenuGroup._Menus[Path] else self = BASE:Inherit( self, MENU_BASE:New( MenuText, ParentMenu ) ) - if MenuGroup:IsAlive() then + --if MenuGroup:IsAlive() then MenuGroup._Menus[Path] = self - end + --end self.MenuGroup = MenuGroup self.Path = Path @@ -886,9 +886,9 @@ do else self = BASE:Inherit( self, MENU_COMMAND_BASE:New( MenuText, ParentMenu, CommandMenuFunction, arg ) ) - if MenuGroup:IsAlive() then + --if MenuGroup:IsAlive() then MenuGroup._Menus[Path] = self - end + --end self.Path = Path self.MenuGroup = MenuGroup diff --git a/Moose Development/Moose/Tasking/DetectionManager.lua b/Moose Development/Moose/Tasking/DetectionManager.lua index 7601701a0..7283d50d9 100644 --- a/Moose Development/Moose/Tasking/DetectionManager.lua +++ b/Moose Development/Moose/Tasking/DetectionManager.lua @@ -76,6 +76,7 @@ do -- DETECTION MANAGER self:SetReportInterval( 30 ) self:SetReportDisplayTime( 25 ) + self:E( { Detection = Detection } ) Detection:__Start( 1 ) return self diff --git a/Moose Development/Moose/Tasking/Mission.lua b/Moose Development/Moose/Tasking/Mission.lua index dfc45aaab..00451544a 100644 --- a/Moose Development/Moose/Tasking/Mission.lua +++ b/Moose Development/Moose/Tasking/Mission.lua @@ -549,7 +549,7 @@ function MISSION:GetTasksRemaining() local TasksRemaining = 0 for TaskID, Task in pairs( self:GetTasks() ) do local Task = Task -- Tasking.Task#TASK - if Task:IsStateSuccess() or Task:IsStateFAILED() then + if Task:IsStateSuccess() or Task:IsStateFailed() then else TasksRemaining = TasksRemaining + 1 end