#Fixes from dev

This commit is contained in:
Applevangelist
2023-02-23 10:30:51 +01:00
parent 9cfed56847
commit e95c1ad3aa
11 changed files with 844 additions and 846 deletions

View File

@@ -703,11 +703,11 @@ function POSITIONABLE:IsSubmarine()
if DCSUnit then
local UnitDescriptor = DCSUnit:getDesc()
if UnitDescriptor.attributes["Submarines"] == true then
return true
else
return false
end
if UnitDescriptor.attributes["Submarines"] == true then
return true
else
return false
end
end
self:E( { "Cannot check IsSubmarine", Positionable = self, Alive = self:IsAlive() } )
@@ -1768,6 +1768,7 @@ do -- Cargo
["tt_DSHK"] = 6,
["HL_KORD"] = 6,
["HL_DSHK"] = 6,
["CCKW_353"] = 16, --GMC CCKW 2½-ton 6×6 truck, estimating 16 soldiers
}
-- Assuming that each passenger weighs 95 kg on average.

View File

@@ -4,7 +4,7 @@
--
-- ### Author: **FlightControl**
--
-- ### Contributions: **Applevangelist**
-- ### Contributions: **Applevangelist**, **funkyfranky**
--
-- ===
--
@@ -12,12 +12,12 @@
-- @image Wrapper_Scenery.JPG
--- @type SCENERY
-- @field #string ClassName
-- @field #string SceneryName
-- @field #DCS.Object SceneryObject
-- @field #number Life0
--- SCENERY Class
-- @type SCENERY
-- @field #string ClassName Name of the class.
-- @field #string SceneryName Name of the scenery object.
-- @field DCS#Object SceneryObject DCS scenery object.
-- @field #number Life0 Initial life points.
-- @extends Wrapper.Positionable#POSITIONABLE
@@ -37,12 +37,16 @@ SCENERY = {
--- Register scenery object as POSITIONABLE.
--@param #SCENERY self
--@param #string SceneryName Scenery name.
--@param #DCS.Object SceneryObject DCS scenery object.
--@param DCS#Object SceneryObject DCS scenery object.
--@return #SCENERY Scenery object.
function SCENERY:Register( SceneryName, SceneryObject )
local self = BASE:Inherit( self, POSITIONABLE:New( SceneryName ) )
self.SceneryName = SceneryName
self.SceneryObject = SceneryObject
if self.SceneryObject then
self.Life0 = self.SceneryObject:getLife()
else
@@ -53,7 +57,7 @@ end
--- Obtain DCS Object from the SCENERY Object.
--@param #SCENERY self
--@return #DCS.Object DCS scenery object.
--@return DCS#Object DCS scenery object.
function SCENERY:GetDCSObject()
return self.SceneryObject
end
@@ -69,7 +73,7 @@ function SCENERY:GetLife()
return life
end
--- Get current initial life points from the SCENERY Object.
--- Get initial life points of the SCENERY Object.
--@param #SCENERY self
--@return #number life
function SCENERY:GetLife0()
@@ -90,7 +94,7 @@ function SCENERY:IsDead()
return self:GetLife() < 1 and true or false
end
--- Get the threat level of a SCENERY object. Always 0.
--- Get the threat level of a SCENERY object. Always 0 as scenery does not pose a threat to anyone.
--@param #SCENERY self
--@return #number Threat level 0.
--@return #string "Scenery".

View File

@@ -89,9 +89,9 @@
--
-- @field #UNIT
UNIT = {
ClassName="UNIT",
UnitName=nil,
GroupName=nil,
ClassName="UNIT",
UnitName=nil,
GroupName=nil,
}
@@ -167,7 +167,7 @@ end
--- Get the DCS unit object.
-- @param #UNIT self
-- @return DCS#Unit
-- @return DCS#Unit The DCS unit object.
function UNIT:GetDCSObject()
local DCSUnit = Unit.getByName( self.UnitName )
@@ -325,14 +325,19 @@ function UNIT:IsAlive()
local DCSUnit = self:GetDCSObject() -- DCS#Unit
if DCSUnit then
local UnitIsAlive = DCSUnit:isExist() and DCSUnit:isActive()
local UnitIsAlive = DCSUnit:isExist() and DCSUnit:isActive() -- and DCSUnit:getLife() > 1
return UnitIsAlive
end
return nil
end
--- Returns if the Unit is dead.
-- @param #UNIT self
-- @return #boolean `true` if Unit is dead, else false or nil if the unit does not exist
function UNIT:IsDead()
return not self:IsAlive()
end
--- Returns the Unit's callsign - the localized string.
-- @param #UNIT self
@@ -626,7 +631,7 @@ function UNIT:IsFuelSupply()
return false
end
--- Returns the unit's group if it exist and nil otherwise.
--- Returns the unit's group if it exists and nil otherwise.
-- @param Wrapper.Unit#UNIT self
-- @return Wrapper.Group#GROUP The Group of the Unit or `nil` if the unit does not exist.
function UNIT:GetGroup()