mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
Pushing a fix for the cargo destroys after respawn.
This commit is contained in:
parent
a0ac366bec
commit
80545fa208
@ -274,7 +274,13 @@ end
|
|||||||
-- @usage
|
-- @usage
|
||||||
-- -- Ship unit example: destroy the Ship silently.
|
-- -- Ship unit example: destroy the Ship silently.
|
||||||
-- Ship = GROUP:FindByName( "Ship" )
|
-- Ship = GROUP:FindByName( "Ship" )
|
||||||
-- Ship:Destroy( true )
|
-- Ship:Destroy()
|
||||||
|
--
|
||||||
|
-- @usage
|
||||||
|
-- -- Destroy without event generation example.
|
||||||
|
-- Ship = GROUP:FindByName( "Boat" )
|
||||||
|
-- Ship:Destroy( false ) -- Don't generate an event upon destruction.
|
||||||
|
--
|
||||||
function GROUP:Destroy( GenerateEvent )
|
function GROUP:Destroy( GenerateEvent )
|
||||||
self:F2( self.GroupName )
|
self:F2( self.GroupName )
|
||||||
|
|
||||||
@ -288,6 +294,8 @@ function GROUP:Destroy( GenerateEvent )
|
|||||||
else
|
else
|
||||||
self:CreateEventDead( timer.getTime(), UnitData )
|
self:CreateEventDead( timer.getTime(), UnitData )
|
||||||
end
|
end
|
||||||
|
elseif GenerateEvent == false then
|
||||||
|
-- Do nothing!
|
||||||
else
|
else
|
||||||
self:CreateEventRemoveUnit( timer.getTime(), UnitData )
|
self:CreateEventRemoveUnit( timer.getTime(), UnitData )
|
||||||
end
|
end
|
||||||
|
|||||||
@ -73,6 +73,24 @@ end
|
|||||||
-- @param #POSITIONABLE self
|
-- @param #POSITIONABLE self
|
||||||
-- @param #boolean GenerateEvent (Optional) true if you want to generate a crash or dead event for the unit.
|
-- @param #boolean GenerateEvent (Optional) true if you want to generate a crash or dead event for the unit.
|
||||||
-- @return #nil The DCS Unit is not existing or alive.
|
-- @return #nil The DCS Unit is not existing or alive.
|
||||||
|
-- @usage
|
||||||
|
-- -- Air unit example: destroy the Helicopter and generate a S_EVENT_CRASH for each unit in the Helicopter group.
|
||||||
|
-- Helicopter = UNIT:FindByName( "Helicopter" )
|
||||||
|
-- Helicopter:Destroy( true )
|
||||||
|
-- @usage
|
||||||
|
-- -- Ground unit example: destroy the Tanks and generate a S_EVENT_DEAD for each unit in the Tanks group.
|
||||||
|
-- Tanks = UNIT:FindByName( "Tanks" )
|
||||||
|
-- Tanks:Destroy( true )
|
||||||
|
-- @usage
|
||||||
|
-- -- Ship unit example: destroy the Ship silently.
|
||||||
|
-- Ship = STATIC:FindByName( "Ship" )
|
||||||
|
-- Ship:Destroy()
|
||||||
|
--
|
||||||
|
-- @usage
|
||||||
|
-- -- Destroy without event generation example.
|
||||||
|
-- Ship = STATIC:FindByName( "Boat" )
|
||||||
|
-- Ship:Destroy( false ) -- Don't generate an event upon destruction.
|
||||||
|
--
|
||||||
function POSITIONABLE:Destroy( GenerateEvent )
|
function POSITIONABLE:Destroy( GenerateEvent )
|
||||||
self:F2( self.ObjectName )
|
self:F2( self.ObjectName )
|
||||||
|
|
||||||
@ -90,6 +108,8 @@ function POSITIONABLE:Destroy( GenerateEvent )
|
|||||||
else
|
else
|
||||||
self:CreateEventDead( timer.getTime(), DCSObject )
|
self:CreateEventDead( timer.getTime(), DCSObject )
|
||||||
end
|
end
|
||||||
|
elseif GenerateEvent == false then
|
||||||
|
-- Do nothing!
|
||||||
else
|
else
|
||||||
self:CreateEventRemoveUnit( timer.getTime(), DCSObject )
|
self:CreateEventRemoveUnit( timer.getTime(), DCSObject )
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user