mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
#Fixes
This commit is contained in:
parent
3564843e1b
commit
669e55d435
@ -6990,7 +6990,29 @@ do -- SET_SCENERY
|
|||||||
|
|
||||||
return CountU
|
return CountU
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Get a table of alive objects.
|
||||||
|
-- @param #SET_GROUP self
|
||||||
|
-- @return #table Table of alive objects
|
||||||
|
-- @return Core.Set#SET_SCENERY SET of alive objects
|
||||||
|
function SET_SCENERY:GetAliveSet()
|
||||||
|
self:F2()
|
||||||
|
|
||||||
|
local AliveSet = SET_SCENERY:New()
|
||||||
|
|
||||||
|
-- Clean the Set before returning with only the alive Groups.
|
||||||
|
for GroupName, GroupObject in pairs( self.Set ) do
|
||||||
|
local GroupObject = GroupObject -- Wrapper.Group#GROUP
|
||||||
|
if GroupObject then
|
||||||
|
if GroupObject:IsAlive() then
|
||||||
|
AliveSet:Add( GroupName, GroupObject )
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return AliveSet.Set or {}, AliveSet
|
||||||
|
end
|
||||||
|
|
||||||
--- Iterate the SET_SCENERY and call an iterator function for each **alive** SCENERY, providing the SCENERY and optional parameters.
|
--- Iterate the SET_SCENERY and call an iterator function for each **alive** SCENERY, providing the SCENERY and optional parameters.
|
||||||
-- @param #SET_SCENERY self
|
-- @param #SET_SCENERY self
|
||||||
-- @param #function IteratorFunction The function that will be called when there is an alive SCENERY in the SET_SCENERY. The function needs to accept a SCENERY parameter.
|
-- @param #function IteratorFunction The function that will be called when there is an alive SCENERY in the SET_SCENERY. The function needs to accept a SCENERY parameter.
|
||||||
|
|||||||
@ -2821,6 +2821,7 @@ function PLAYERTASKCONTROLLER:_JoinTask(Group, Client, Task, Force)
|
|||||||
Task:AddClient(Client)
|
Task:AddClient(Client)
|
||||||
local joined = self.gettext:GetEntry("PILOTJOINEDTASK",self.locale)
|
local joined = self.gettext:GetEntry("PILOTJOINEDTASK",self.locale)
|
||||||
-- PILOTJOINEDTASK = "%s, %s. You have been assigned %s task %03d",
|
-- PILOTJOINEDTASK = "%s, %s. You have been assigned %s task %03d",
|
||||||
|
--self:I(string.format("Task %s | TaskType %s | Number %s | Type %s",self.MenuName or self.Name, Task.TTSType, tonumber(Task.PlayerTaskNr),type(Task.PlayerTaskNr)))
|
||||||
local text = string.format(joined,ttsplayername, self.MenuName or self.Name, Task.TTSType, Task.PlayerTaskNr)
|
local text = string.format(joined,ttsplayername, self.MenuName or self.Name, Task.TTSType, Task.PlayerTaskNr)
|
||||||
self:T(self.lid..text)
|
self:T(self.lid..text)
|
||||||
if not self.NoScreenOutput then
|
if not self.NoScreenOutput then
|
||||||
|
|||||||
@ -617,7 +617,7 @@ function TARGET:onafterStatus(From, Event, To)
|
|||||||
-- Log output verbose=1.
|
-- Log output verbose=1.
|
||||||
if self.verbose>=1 then
|
if self.verbose>=1 then
|
||||||
local text=string.format("%s: Targets=%d/%d Life=%.1f/%.1f Damage=%.1f", fsmstate, self:CountTargets(), self.N0, self:GetLife(), self:GetLife0(), self:GetDamage())
|
local text=string.format("%s: Targets=%d/%d Life=%.1f/%.1f Damage=%.1f", fsmstate, self:CountTargets(), self.N0, self:GetLife(), self:GetLife0(), self:GetDamage())
|
||||||
if self:CountTargets() == 0 then
|
if self:CountTargets() == 0 or self:GetDamage() >= 100 then
|
||||||
text=text.." Dead!"
|
text=text.." Dead!"
|
||||||
elseif damaged then
|
elseif damaged then
|
||||||
text=text.." Damaged!"
|
text=text.." Damaged!"
|
||||||
@ -636,7 +636,7 @@ function TARGET:onafterStatus(From, Event, To)
|
|||||||
self:I(self.lid..text)
|
self:I(self.lid..text)
|
||||||
end
|
end
|
||||||
|
|
||||||
if self:CountTargets() == 0 then
|
if self:CountTargets() == 0 or self:GetDamage() >= 100 then
|
||||||
self:Dead()
|
self:Dead()
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -935,6 +935,9 @@ function TARGET:_AddObject(Object)
|
|||||||
target.Coordinate=scenery:GetCoordinate()
|
target.Coordinate=scenery:GetCoordinate()
|
||||||
|
|
||||||
target.Life0=scenery:GetLife0()
|
target.Life0=scenery:GetLife0()
|
||||||
|
|
||||||
|
if target.Life0==0 then target.Life0 = 1 end
|
||||||
|
|
||||||
target.Life=scenery:GetLife()
|
target.Life=scenery:GetLife()
|
||||||
|
|
||||||
target.N0=target.N0+1
|
target.N0=target.N0+1
|
||||||
@ -1071,7 +1074,9 @@ function TARGET:GetTargetLife(Target)
|
|||||||
elseif Target.Type==TARGET.ObjectType.STATIC then
|
elseif Target.Type==TARGET.ObjectType.STATIC then
|
||||||
|
|
||||||
if Target.Object and Target.Object:IsAlive() then
|
if Target.Object and Target.Object:IsAlive() then
|
||||||
return 1
|
local life=Target.Object:GetLife()
|
||||||
|
return life
|
||||||
|
--return 1
|
||||||
else
|
else
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user