mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2026-08-22 16:05:25 +00:00
@shadowze I've done a fix to remove the event handlers from SET_CARGO using :FilterStop(). Can you check this please?
This commit is contained in:
@@ -503,7 +503,6 @@ function EVENT:RemoveEvent( EventClass, EventID )
|
|||||||
self.Events = self.Events or {}
|
self.Events = self.Events or {}
|
||||||
self.Events[EventID] = self.Events[EventID] or {}
|
self.Events[EventID] = self.Events[EventID] or {}
|
||||||
self.Events[EventID][EventPriority] = self.Events[EventID][EventPriority] or {}
|
self.Events[EventID][EventPriority] = self.Events[EventID][EventPriority] or {}
|
||||||
self.Events[EventID][EventPriority][EventClass] = self.Events[EventID][EventPriority][EventClass]
|
|
||||||
|
|
||||||
self.Events[EventID][EventPriority][EventClass] = nil
|
self.Events[EventID][EventPriority][EventClass] = nil
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,8 @@
|
|||||||
-- @image Core_Sets.JPG
|
-- @image Core_Sets.JPG
|
||||||
|
|
||||||
|
|
||||||
|
do -- SET_BASE
|
||||||
|
|
||||||
--- @type SET_BASE
|
--- @type SET_BASE
|
||||||
-- @field #table Filter
|
-- @field #table Filter
|
||||||
-- @field #table Set
|
-- @field #table Set
|
||||||
@@ -641,6 +643,10 @@ function SET_BASE:Flush( MasterObject )
|
|||||||
return ObjectNames
|
return ObjectNames
|
||||||
end
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
do -- SET_GROUP
|
||||||
|
|
||||||
--- @type SET_GROUP
|
--- @type SET_GROUP
|
||||||
-- @extends Core.Set#SET_BASE
|
-- @extends Core.Set#SET_BASE
|
||||||
@@ -1488,6 +1494,8 @@ function SET_GROUP:SetCargoBayWeightLimit()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
do -- SET_UNIT
|
do -- SET_UNIT
|
||||||
|
|
||||||
@@ -3206,7 +3214,9 @@ do -- SET_STATIC
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- SET_CLIENT
|
|
||||||
|
|
||||||
|
do -- SET_CLIENT
|
||||||
|
|
||||||
|
|
||||||
--- @type SET_CLIENT
|
--- @type SET_CLIENT
|
||||||
@@ -3654,9 +3664,13 @@ function SET_CLIENT:IsIncludeObject( MClient )
|
|||||||
return MClientInclude
|
return MClientInclude
|
||||||
end
|
end
|
||||||
|
|
||||||
--- SET_PLAYER
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
do -- SET_PLAYER
|
||||||
|
|
||||||
--- @type SET_PLAYER
|
--- @type SET_PLAYER
|
||||||
-- @extends Core.Set#SET_BASE
|
-- @extends Core.Set#SET_BASE
|
||||||
|
|
||||||
@@ -4054,6 +4068,13 @@ function SET_PLAYER:IsIncludeObject( MClient )
|
|||||||
return MClientInclude
|
return MClientInclude
|
||||||
end
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
do -- SET_AIRBASE
|
||||||
|
|
||||||
--- @type SET_AIRBASE
|
--- @type SET_AIRBASE
|
||||||
-- @extends Core.Set#SET_BASE
|
-- @extends Core.Set#SET_BASE
|
||||||
|
|
||||||
@@ -4391,6 +4412,13 @@ function SET_AIRBASE:IsIncludeObject( MAirbase )
|
|||||||
return MAirbaseInclude
|
return MAirbaseInclude
|
||||||
end
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
do -- SET_CARGO
|
||||||
|
|
||||||
--- @type SET_CARGO
|
--- @type SET_CARGO
|
||||||
-- @extends Core.Set#SET_BASE
|
-- @extends Core.Set#SET_BASE
|
||||||
|
|
||||||
@@ -4613,6 +4641,17 @@ function SET_CARGO:FilterStart() --R2.1
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Stops the filtering for the defined collection.
|
||||||
|
-- @param #SET_CARGO self
|
||||||
|
-- @return #SET_CARGO self
|
||||||
|
function SET_CARGO:FilterStop()
|
||||||
|
|
||||||
|
self:UnHandleEvent( EVENTS.NewCargo )
|
||||||
|
self:UnHandleEvent( EVENTS.DeleteCargo )
|
||||||
|
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
--- (R2.1) Handles the Database to check on an event (birth) that the Object was added in the Database.
|
--- (R2.1) Handles the Database to check on an event (birth) that the Object was added in the Database.
|
||||||
-- This is required, because sometimes the _DATABASE birth event gets called later than the SET_BASE birth event!
|
-- This is required, because sometimes the _DATABASE birth event gets called later than the SET_BASE birth event!
|
||||||
@@ -4821,8 +4860,11 @@ function SET_CARGO:OnEventDeleteCargo( EventData ) --R2.1
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
do -- SET_ZONE
|
||||||
|
|
||||||
--- @type SET_ZONE
|
--- @type SET_ZONE
|
||||||
-- @extends Core.Set#SET_BASE
|
-- @extends Core.Set#SET_BASE
|
||||||
|
|
||||||
@@ -5017,6 +5059,17 @@ function SET_ZONE:FilterStart()
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Stops the filtering for the defined collection.
|
||||||
|
-- @param #SET_ZONE self
|
||||||
|
-- @return #SET_ZONE self
|
||||||
|
function SET_ZONE:FilterStop()
|
||||||
|
|
||||||
|
self:UnHandleEvent( EVENTS.NewZone )
|
||||||
|
self:UnHandleEvent( EVENTS.DeleteZone )
|
||||||
|
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
--- Handles the Database to check on an event (birth) that the Object was added in the Database.
|
--- Handles the Database to check on an event (birth) that the Object was added in the Database.
|
||||||
-- This is required, because sometimes the _DATABASE birth event gets called later than the SET_BASE birth event!
|
-- This is required, because sometimes the _DATABASE birth event gets called later than the SET_BASE birth event!
|
||||||
-- @param #SET_ZONE self
|
-- @param #SET_ZONE self
|
||||||
@@ -5140,3 +5193,5 @@ function SET_ZONE:IsCoordinateInZone( Coordinate )
|
|||||||
|
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user