Minor fixes.

Positionalble: Added isExist because of problems with getting coords from scenery objects.
Suppresson: Fixes. Added new transitions.
PseudoATC: Removed eject.
Artillery: Optimized debug output.
This commit is contained in:
funkyfranky
2018-05-10 15:40:10 +02:00
parent f9d7eea721
commit 6f0507ea7f
5 changed files with 69 additions and 46 deletions

View File

@@ -391,7 +391,7 @@ function POSITIONABLE:GetVelocityVec3()
local DCSPositionable = self:GetDCSObject()
if DCSPositionable then
if DCSPositionable and DCSPositionable:isExist() then
local PositionableVelocityVec3 = DCSPositionable:getVelocity()
self:T3( PositionableVelocityVec3 )
return PositionableVelocityVec3
@@ -433,7 +433,7 @@ function POSITIONABLE:GetVelocityKMH()
local DCSPositionable = self:GetDCSObject()
if DCSPositionable then
if DCSPositionable and DCSPositionable:isExist() then
local VelocityVec3 = self:GetVelocityVec3()
local Velocity = ( VelocityVec3.x ^ 2 + VelocityVec3.y ^ 2 + VelocityVec3.z ^ 2 ) ^ 0.5 -- in meters / sec
local Velocity = Velocity * 3.6 -- now it is in km/h.
@@ -452,7 +452,7 @@ function POSITIONABLE:GetVelocityMPS()
local DCSPositionable = self:GetDCSObject()
if DCSPositionable then
if DCSPositionable and DCSPositionable:isExist() then
local VelocityVec3 = self:GetVelocityVec3()
local Velocity = ( VelocityVec3.x ^ 2 + VelocityVec3.y ^ 2 + VelocityVec3.z ^ 2 ) ^ 0.5 -- in meters / sec
self:T3( Velocity )