Added CARGO_CRATE

Added a new object called CARGO_CRATE
This commit is contained in:
FlightControl_Master
2017-10-12 11:02:56 +02:00
parent d5c7d0028b
commit 0cc36b5ee2
7 changed files with 448 additions and 319 deletions

View File

@@ -224,6 +224,7 @@ function GROUP:Destroy()
for Index, UnitData in pairs( DCSGroup:getUnits() ) do
self:CreateEventCrash( timer.getTime(), UnitData )
end
USERFLAG:New( self:GetName() ):Set( 100 )
DCSGroup:destroy()
DCSGroup = nil
end
@@ -231,6 +232,7 @@ function GROUP:Destroy()
return nil
end
--- Returns category of the DCS Group.
-- @param #GROUP self
-- @return Dcs.DCSWrapper.Group#Group.Category The category ID

View File

@@ -79,7 +79,6 @@ function OBJECT:Destroy()
local DCSObject = self:GetDCSObject()
if DCSObject then
USERFLAG:New( self:GetGroup():GetName() ):Set( 100 )
--BASE:CreateEventCrash( timer.getTime(), DCSObject )
DCSObject:destroy()
end

View File

@@ -61,7 +61,6 @@ function STATIC:FindByName( StaticName, RaiseError )
if StaticFound then
StaticFound:F3( { StaticName } )
return StaticFound
end
@@ -92,4 +91,18 @@ end
function STATIC:GetThreatLevel()
return 1, "Static"
end
end
--- Respawn the @{Unit} using a (tweaked) template of the parent Group.
-- @param #UNIT self
-- @param Core.Point#COORDINATE Coordinate The coordinate where to spawn the new Static.
-- @param #number Heading The heading of the unit respawn.
function STATIC:ReSpawn( Coordinate, Heading )
-- todo: need to fix country
local SpawnStatic = SPAWNSTATIC:NewFromStatic( self.StaticName, country.id.USA )
SpawnStatic:SpawnFromPointVec2( Coordinate, Heading, self.StaticName )
end

View File

@@ -159,6 +159,24 @@ function UNIT:GetDCSObject()
return nil
end
--- Destroys the UNIT.
-- @param #UNIT self
-- @return #nil The DCS Unit is not existing or alive.
function UNIT:Destroy()
self:F2( self.ObjectName )
local DCSObject = self:GetDCSObject()
if DCSObject then
USERFLAG:New( self:GetGroup():GetName() ):Set( 100 )
--BASE:CreateEventCrash( timer.getTime(), DCSObject )
DCSObject:destroy()
end
return nil
end
--- Respawn the @{Unit} using a (tweaked) template of the parent Group.
--
-- This function will: