mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Update OpsGroup.lua
This commit is contained in:
parent
770fb3228f
commit
94863ed8ae
@ -3497,8 +3497,15 @@ function OPSGROUP:SetLaserTarget(Target)
|
||||
|
||||
if Target then
|
||||
|
||||
-- Check if we have a POSITIONABLE.
|
||||
if Target:IsInstanceOf("POSITIONABLE") then
|
||||
-- Check object type.
|
||||
if Target:IsInstanceOf("SCENERY") then
|
||||
|
||||
-- Scenery as target. Treat it like a coordinate. Set offset to 1 meter above ground.
|
||||
self.spot.TargetType=0
|
||||
self.spot.offsetTarget={x=0, y=1, z=0}
|
||||
|
||||
elseif Target:IsInstanceOf("POSITIONABLE") then
|
||||
|
||||
local target=Target --Wrapper.Positionable#POSITIONABLE
|
||||
|
||||
if target:IsAlive() then
|
||||
@ -3535,13 +3542,11 @@ function OPSGROUP:SetLaserTarget(Target)
|
||||
end
|
||||
|
||||
elseif Target:IsInstanceOf("COORDINATE") then
|
||||
|
||||
-- Coordinate as target.
|
||||
self.spot.TargetType=0
|
||||
self.spot.offsetTarget={x=0, y=0, z=0}
|
||||
elseif Target:IsInstanceOf("SCENERY") then
|
||||
-- Coordinate as target.
|
||||
self.spot.TargetType=0
|
||||
self.spot.offsetTarget={x=0, y=1, z=0}
|
||||
|
||||
else
|
||||
self:E(self.lid.."ERROR: LASER target should be a POSITIONABLE (GROUP, UNIT or STATIC) or a COORDINATE object!")
|
||||
return
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user