From dae78d7ac1e97f272fad121478adaf1c2f1b49f6 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Fri, 16 Jun 2023 11:06:46 +0200 Subject: [PATCH] #Positionable, Unit - remove pcall --- .../Moose/Wrapper/Positionable.lua | 22 +++++++++---------- Moose Development/Moose/Wrapper/Unit.lua | 22 +++++++++---------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/Moose Development/Moose/Wrapper/Positionable.lua b/Moose Development/Moose/Wrapper/Positionable.lua index 669cbac56..571e0d48c 100644 --- a/Moose Development/Moose/Wrapper/Positionable.lua +++ b/Moose Development/Moose/Wrapper/Positionable.lua @@ -239,18 +239,18 @@ end function POSITIONABLE:GetVec3() local DCSPositionable = self:GetDCSObject() if DCSPositionable then - local status, vec3 = pcall( - function() - local vec3 = DCSPositionable:getPoint() - return vec3 - end - ) - --local vec3 = DCSPositionable:getPoint() - if status then + --local status, vec3 = pcall( + -- function() + -- local vec3 = DCSPositionable:getPoint() + -- return vec3 + --end + --) + local vec3 = DCSPositionable:getPoint() + --if status then return vec3 - else - self:E( { "Cannot get Vec3 from DCS Object", Positionable = self, Alive = self:IsAlive() } ) - end + --else + --self:E( { "Cannot get Vec3 from DCS Object", Positionable = self, Alive = self:IsAlive() } ) + --end end -- ERROR! self:E( { "Cannot get the Positionable DCS Object for GetVec3", Positionable = self, Alive = self:IsAlive() } ) diff --git a/Moose Development/Moose/Wrapper/Unit.lua b/Moose Development/Moose/Wrapper/Unit.lua index fe5e771e0..496e7cef1 100644 --- a/Moose Development/Moose/Wrapper/Unit.lua +++ b/Moose Development/Moose/Wrapper/Unit.lua @@ -703,17 +703,17 @@ function UNIT:GetAmmo() self:F2( self.UnitName ) local DCSUnit = self:GetDCSObject() if DCSUnit then - local status, unitammo = pcall( - function() - local UnitAmmo = DCSUnit:getAmmo() - return UnitAmmo - end - ) - if status then - return unitammo - end - --local UnitAmmo = DCSUnit:getAmmo() - --return UnitAmmo + --local status, unitammo = pcall( + -- function() + -- local UnitAmmo = DCSUnit:getAmmo() + -- return UnitAmmo + --end + --) + --if status then + --return unitammo + --end + local UnitAmmo = DCSUnit:getAmmo() + return UnitAmmo end return nil end