mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
OpsGroup
- Fixed bug in checklos
This commit is contained in:
parent
20a9857fcf
commit
ffef3183c7
@ -2249,20 +2249,12 @@ function ARTY:OnEventShot(EventData)
|
|||||||
self:T3(self.lid.."EVENT SHOT: Weapon name = ".._weaponName)
|
self:T3(self.lid.."EVENT SHOT: Weapon name = ".._weaponName)
|
||||||
|
|
||||||
local group = EventData.IniGroup --Wrapper.Group#GROUP
|
local group = EventData.IniGroup --Wrapper.Group#GROUP
|
||||||
|
|
||||||
env.info("FF 100")
|
|
||||||
|
|
||||||
if group and group:IsAlive() then
|
if group and group:IsAlive() then
|
||||||
|
|
||||||
env.info("FF 200")
|
|
||||||
|
|
||||||
if EventData.IniGroupName == self.groupname then
|
if EventData.IniGroupName == self.groupname then
|
||||||
|
|
||||||
env.info("FF 300")
|
|
||||||
|
|
||||||
if self.currentTarget then
|
if self.currentTarget then
|
||||||
|
|
||||||
env.info("FF 400")
|
|
||||||
|
|
||||||
-- Increase number of shots fired by this group on this target.
|
-- Increase number of shots fired by this group on this target.
|
||||||
self.Nshots=self.Nshots+1
|
self.Nshots=self.Nshots+1
|
||||||
@ -2856,7 +2848,6 @@ function ARTY:onafterStatus(Controllable, From, Event, To)
|
|||||||
end
|
end
|
||||||
for _,targetname in pairs(notpossible) do
|
for _,targetname in pairs(notpossible) do
|
||||||
self:E(self.lid..string.format("%s: Removing target %s because requested weapon is not possible with this type of unit.", self.groupname, targetname))
|
self:E(self.lid..string.format("%s: Removing target %s because requested weapon is not possible with this type of unit.", self.groupname, targetname))
|
||||||
env.info("FF 1000",showMessageBox)
|
|
||||||
self:RemoveTarget(targetname)
|
self:RemoveTarget(targetname)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -1683,7 +1683,7 @@ function OPSGROUP:HasLoS(Coordinate, Element, OffsetElement, OffsetCoordinate)
|
|||||||
-- Check los for the given element.
|
-- Check los for the given element.
|
||||||
if Element.unit and Element.unit:IsAlive() then
|
if Element.unit and Element.unit:IsAlive() then
|
||||||
local vec3=Element.unit:GetVec3()
|
local vec3=Element.unit:GetVec3()
|
||||||
local los=checklos(Element)
|
local los=checklos(vec3)
|
||||||
return los
|
return los
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -7091,6 +7091,8 @@ function OPSGROUP:SetLaserTarget(Target)
|
|||||||
|
|
||||||
-- Set coordinate.
|
-- Set coordinate.
|
||||||
self.spot.Coordinate:UpdateFromVec3(self.spot.vec3)
|
self.spot.Coordinate:UpdateFromVec3(self.spot.vec3)
|
||||||
|
|
||||||
|
self.spot.Coordinate:MarkToAll("Target Laser",ReadOnly,Text)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user