Ready for another test session.

This commit is contained in:
FlightControl_Master
2018-04-11 09:14:12 +02:00
parent ffe4d9a143
commit 1ae1b9abd7
13 changed files with 172 additions and 45 deletions

View File

@@ -268,8 +268,7 @@ do -- CARGO
self.Slingloadable = false
self.Moveable = false
self.Containable = false
self.LoadAction = ""
self.CargoLimit = 0
self.LoadRadius = LoadRadius or 500
@@ -369,6 +368,14 @@ do -- CARGO
end
--- Get the transportation method of the Cargo.
-- @param #CARGO self
-- @return #string The transportation method of the Cargo.
function CARGO:GetTransportationMethod()
return self.TransportationMethod
end
--- Get the coalition of the Cargo.
-- @param #CARGO self
-- @return Coalition
@@ -802,7 +809,7 @@ do -- CARGO_REPRESENTABLE
-- Cargo objects are deleted from the _DATABASE and SET_CARGO objects.
self:F( { CargoName = self:GetName() } )
_EVENTDISPATCHER:CreateEventDeleteCargo( self )
--_EVENTDISPATCHER:CreateEventDeleteCargo( self )
return self
end

View File

@@ -49,7 +49,7 @@ do -- CARGO_CRATE
local self = BASE:Inherit( self, CARGO_REPRESENTABLE:New( CargoStatic, Type, Name, nil, LoadRadius, NearRadius ) ) -- #CARGO_CRATE
self:F( { Type, Name, NearRadius } )
self.CargoObject = CargoStatic
self.CargoObject = CargoStatic -- Wrapper.Static#STATIC
self:T( self.ClassName )
@@ -73,7 +73,9 @@ do -- CARGO_CRATE
if self:IsDestroyed() or self:IsUnLoaded() or self:IsBoarding() then
if self.CargoObject:GetName() == EventData.IniUnitName then
Destroyed = true
if not self.NoDestroy then
Destroyed = true
end
end
else
if self:IsLoaded() then
@@ -90,7 +92,7 @@ do -- CARGO_CRATE
self:I( { "Cargo crate destroyed: " .. self.CargoObject:GetName() } )
self:Destroyed()
end
end
@@ -145,7 +147,10 @@ do -- CARGO_CRATE
-- Only destroy the CargoObject is if there is a CargoObject (packages don't have CargoObjects).
if self.CargoObject then
self:T("Destroying")
self.NoDestroy = true
self.CargoObject:Destroy()
--local Coordinate = self.CargoObject:GetCoordinate():GetRandomCoordinateInRadius( 50, 20 )
--self.CargoObject:ReSpawnAt( Coordinate, 0 )
end
end
@@ -290,6 +295,24 @@ do -- CARGO_CRATE
end
--- Get the transportation method of the Cargo.
-- @param #CARGO_CRATE self
-- @return #string The transportation method of the Cargo.
function CARGO_CRATE:GetTransportationMethod()
if self:IsLoaded() then
return "for unloading"
else
if self:IsUnLoaded() then
return "for loading"
else
if self:IsDeployed() then
return "delivered"
end
end
end
return ""
end
end

View File

@@ -584,4 +584,24 @@ do -- CARGO_GROUP
end
--- Get the transportation method of the Cargo.
-- @param #CARGO_GROUP self
-- @return #string The transportation method of the Cargo.
function CARGO_GROUP:GetTransportationMethod()
if self:IsLoaded() then
return "for unboarding"
else
if self:IsUnLoaded() then
return "for boarding"
else
if self:IsDeployed() then
return "delivered"
end
end
end
return ""
end
end -- CARGO_GROUP

View File

@@ -74,7 +74,9 @@ do -- CARGO_SLINGLOAD
if self:IsDestroyed() or self:IsUnLoaded() then
if self.CargoObject:GetName() == EventData.IniUnitName then
Destroyed = true
if not self.NoDestroy then
Destroyed = true
end
end
end
@@ -247,5 +249,23 @@ do -- CARGO_SLINGLOAD
end
--- Get the transportation method of the Cargo.
-- @param #CARGO_SLINGLOAD self
-- @return #string The transportation method of the Cargo.
function CARGO_SLINGLOAD:GetTransportationMethod()
if self:IsLoaded() then
return "for sling loading"
else
if self:IsUnLoaded() then
return "for sling loading"
else
if self:IsDeployed() then
return "delivered"
end
end
end
return ""
end
end

View File

@@ -370,4 +370,22 @@ do -- CARGO_UNIT
end
end
--- Get the transportation method of the Cargo.
-- @param #CARGO_UNIT self
-- @return #string The transportation method of the Cargo.
function CARGO_UNIT:GetTransportationMethod()
if self:IsLoaded() then
return "for unboarding"
else
if self:IsUnLoaded() then
return "for boarding"
else
if self:IsDeployed() then
return "delivered"
end
end
end
return ""
end
end -- CARGO_UNIT