From 889ce8f64b2e6234a9acd0f0db4a4379a32db26f Mon Sep 17 00:00:00 2001 From: Frank Date: Thu, 23 May 2019 21:10:48 +0200 Subject: [PATCH] Fixed Database OnEventNewZone function --- Moose Development/Moose/Core/Base.lua | 22 ++++++++++++++++++++-- Moose Development/Moose/Core/Database.lua | 13 +------------ Moose Development/Moose/Core/Event.lua | 18 +++++++++++------- 3 files changed, 32 insertions(+), 21 deletions(-) diff --git a/Moose Development/Moose/Core/Base.lua b/Moose Development/Moose/Core/Base.lua index a72fb0e1f..db2f5ddaf 100644 --- a/Moose Development/Moose/Core/Base.lua +++ b/Moose Development/Moose/Core/Base.lua @@ -595,18 +595,36 @@ do -- Event Handling -- @param Core.Event#EVENTDATA EventData The EventData structure. --- Occurs when any unit begins firing a weapon that has a high rate of fire. Most common with aircraft cannons (GAU-8), autocannons, and machine guns. - -- initiator : The unit that is doing the shooing. + -- initiator : The unit that is doing the shooting. -- target: The unit that is being targeted. -- @function [parent=#BASE] OnEventShootingStart -- @param #BASE self -- @param Core.Event#EVENTDATA EventData The EventData structure. --- Occurs when any unit stops firing its weapon. Event will always correspond with a shooting start event. - -- initiator : The unit that was doing the shooing. + -- initiator : The unit that was doing the shooting. -- @function [parent=#BASE] OnEventShootingEnd -- @param #BASE self -- @param Core.Event#EVENTDATA EventData The EventData structure. + --- Occurs when a new mark was added. + -- MarkID: ID of the mark. + -- @function [parent=#BASE] OnEventMarkAdded + -- @param #BASE self + -- @param Core.Event#EVENTDATA EventData The EventData structure. + + --- Occurs when a mark was removed. + -- MarkID: ID of the mark. + -- @function [parent=#BASE] OnEventMarkRemoved + -- @param #BASE self + -- @param Core.Event#EVENTDATA EventData The EventData structure. + + --- Occurs when a mark text was changed. + -- MarkID: ID of the mark. + -- @function [parent=#BASE] OnEventMarkChange + -- @param #BASE self + -- @param Core.Event#EVENTDATA EventData The EventData structure. + end diff --git a/Moose Development/Moose/Core/Database.lua b/Moose Development/Moose/Core/Database.lua index 5a07d5f5a..0e87d5f7c 100644 --- a/Moose Development/Moose/Core/Database.lua +++ b/Moose Development/Moose/Core/Database.lua @@ -304,16 +304,6 @@ do -- Zones self.ZONES[ZoneName] = nil end - - --- Finds an @{Zone} based on the zone name in the DATABASE. - -- @param #DATABASE self - -- @param #string ZoneName - -- @return Core.Zone#ZONE_BASE The found @{Zone}. - function DATABASE:FindZone( ZoneName ) - - local ZoneFound = self.ZONES[ZoneName] - return ZoneFound - end --- Private method that registers new ZONE_BASE derived objects within the DATABASE Object. @@ -348,7 +338,6 @@ do -- Zones end -- zone - do -- cargo --- Adds a Cargo based on the Cargo Name in the DATABASE. @@ -1166,7 +1155,7 @@ function DATABASE:OnEventNewZone( EventData ) self:F2( { EventData } ) if EventData.Zone then - self:AddZone( EventData.Zone ) + self:AddZone( EventData.Zone.ZoneName, EventData.Zone ) end end diff --git a/Moose Development/Moose/Core/Event.lua b/Moose Development/Moose/Core/Event.lua index 386169cb0..3c00758eb 100644 --- a/Moose Development/Moose/Core/Event.lua +++ b/Moose Development/Moose/Core/Event.lua @@ -272,10 +272,16 @@ EVENTS = { -- @field Wrapper.Airbase#AIRBASE Place The MOOSE airbase object. -- @field #string PlaceName The name of the airbase. -- --- @field weapon The weapon used during the event. --- @field Weapon --- @field WeaponName --- @field WeaponTgtDCSUnit +-- @field #table weapon The weapon used during the event. +-- @field #table Weapon +-- @field #string WeaponName Name of the weapon. +-- @field DCS#Unit WeaponTgtDCSUnit Target DCS unit of the weapon. +-- +-- @field Cargo.Cargo#CARGO Cargo The cargo object. +-- @field #string CargoName The name of the cargo object. +-- +-- @field Core.ZONE#ZONE Zone The zone object. +-- @field #string ZoneName The name of the zone. @@ -959,8 +965,7 @@ function EVENT:onEvent( Event ) Event.PlaceName=Event.Place:GetName() end --- @FC: something like this should be added. ---[[ + -- Mark points. if Event.idx then Event.MarkID=Event.idx Event.MarkVec3=Event.pos @@ -969,7 +974,6 @@ function EVENT:onEvent( Event ) Event.MarkCoalition=Event.coalition Event.MarkGroupID = Event.groupID end -]] if Event.cargo then Event.Cargo = Event.cargo