mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Merge remote-tracking branch 'origin/master' into develop
# Conflicts: # Moose Development/Moose/Wrapper/Object.lua
This commit is contained in:
@@ -929,7 +929,7 @@ end
|
||||
function AIRBASE:GetWarehouse()
|
||||
local warehouse=nil --DCS#Warehouse
|
||||
local airbase=self:GetDCSObject()
|
||||
if airbase then
|
||||
if airbase and Airbase.getWarehouse then
|
||||
warehouse=airbase:getWarehouse()
|
||||
end
|
||||
return warehouse
|
||||
|
||||
@@ -4,20 +4,21 @@
|
||||
--
|
||||
-- ### Author: **FlightControl**
|
||||
--
|
||||
-- ### Contributions:
|
||||
-- ### Contributions: **funkyfranky
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- @module Wrapper.Object
|
||||
-- @image MOOSE.JPG
|
||||
|
||||
---
|
||||
|
||||
--- OBJECT class.
|
||||
-- @type OBJECT
|
||||
-- @extends Core.Base#BASE
|
||||
-- @field #string ObjectName The name of the Object.
|
||||
|
||||
|
||||
--- Wrapper class to hendle the DCS Object objects.
|
||||
--- Wrapper class to handle the DCS Object objects.
|
||||
--
|
||||
-- * Support all DCS Object APIs.
|
||||
-- * Enhance with Object specific APIs not in the DCS Object API set.
|
||||
@@ -43,9 +44,15 @@ OBJECT = {
|
||||
-- @param #OBJECT self
|
||||
-- @param DCS#Object ObjectName The Object name
|
||||
-- @return #OBJECT self
|
||||
function OBJECT:New( ObjectName, Test )
|
||||
function OBJECT:New( ObjectName)
|
||||
|
||||
-- Inherit BASE class.
|
||||
local self = BASE:Inherit( self, BASE:New() )
|
||||
|
||||
-- Debug output.
|
||||
self:F2( ObjectName )
|
||||
|
||||
-- Set object name.
|
||||
self.ObjectName = ObjectName
|
||||
|
||||
return self
|
||||
@@ -64,15 +71,14 @@ function OBJECT:GetID()
|
||||
return ObjectID
|
||||
end
|
||||
|
||||
BASE:E( { "Cannot GetID", Name = self.ObjectName, Class = self:GetClassName() } )
|
||||
self:E( { "Cannot GetID", Name = self.ObjectName, Class = self:GetClassName() } )
|
||||
|
||||
return nil
|
||||
end
|
||||
|
||||
--- Destroys the OBJECT.
|
||||
-- @param #OBJECT self
|
||||
-- @return #boolean true if the object is destroyed.
|
||||
-- @return #nil The DCS Unit is not existing or alive.
|
||||
-- @return #boolean Returns `true` if the object is destroyed or #nil if the object is nil.
|
||||
function OBJECT:Destroy()
|
||||
|
||||
local DCSObject = self:GetDCSObject()
|
||||
@@ -83,7 +89,7 @@ function OBJECT:Destroy()
|
||||
return true
|
||||
end
|
||||
|
||||
BASE:E( { "Cannot Destroy", Name = self.ObjectName, Class = self:GetClassName() } )
|
||||
self:E( { "Cannot Destroy", Name = self.ObjectName, Class = self:GetClassName() } )
|
||||
|
||||
return nil
|
||||
end
|
||||
|
||||
@@ -168,8 +168,10 @@ function STORAGE:New(AirbaseName)
|
||||
local self=BASE:Inherit(self, BASE:New()) -- #STORAGE
|
||||
|
||||
self.airbase=Airbase.getByName(AirbaseName)
|
||||
|
||||
self.warehouse=self.airbase:getWarehouse()
|
||||
|
||||
if Airbase.getWarehouse then
|
||||
self.warehouse=self.airbase:getWarehouse()
|
||||
end
|
||||
|
||||
self.lid = string.format("STORAGE %s", AirbaseName)
|
||||
|
||||
|
||||
@@ -367,7 +367,7 @@ function WEAPON:GetTarget()
|
||||
if object then
|
||||
|
||||
-- Get object category.
|
||||
local category=object:getCategory()
|
||||
local category=Object.getCategory(object)
|
||||
|
||||
--Target name
|
||||
local name=object:getName()
|
||||
|
||||
Reference in New Issue
Block a user