Merge branch 'master' into FF/MasterDevel

This commit is contained in:
Frank
2021-05-01 17:07:56 +02:00

View File

@@ -1082,17 +1082,14 @@ function EVENT:onEvent( Event )
Event.IniCoalition = 0 Event.IniCoalition = 0
Event.IniCategory = 0 Event.IniCategory = 0
Event.IniTypeName = "Ejected Pilot" Event.IniTypeName = "Ejected Pilot"
elseif Event.id == 33 then -- ejection seat discarded
local static=Event.initiator Event.IniDCSUnit = Event.initiator
local vec3=static:getPoint() local ID=Event.initiator.id_
Event.IniDCSUnitName = string.format("Ejection Seat ID %s", tostring(ID))
local template=TEMPLATE.GetGround(TEMPLATE.Ground.SoldierM4, "Ejected Pilot", country.id.USA, vec3) Event.IniUnitName = Event.IniDCSUnitName
local group=_DATABASE:Spawn(template) Event.IniCoalition = 0
Event.IniDCSGroup=group:GetDCSObject() Event.IniCategory = 0
Event.IniCoalition=group:GetCoalition() Event.IniTypeName = "Ejection Seat"
Event.IniCategory=group:GetCategory()
else else
Event.IniDCSUnit = Event.initiator Event.IniDCSUnit = Event.initiator
Event.IniDCSUnitName = Event.IniDCSUnit:getName() Event.IniDCSUnitName = Event.IniDCSUnit:getName()
@@ -1159,25 +1156,34 @@ function EVENT:onEvent( Event )
end end
if Event.TgtObjectCategory == Object.Category.STATIC then if Event.TgtObjectCategory == Object.Category.STATIC then
BASE:T({Event = Event}) BASE:T({StaticTgtEvent = Event.id})
--[[ -- get base data
Event.TgtDCSUnit = Event.target Event.TgtDCSUnit = Event.target
if Event.target:isExist() and Event.id ~= 33 then -- leave out ejected seat object
Event.TgtDCSUnitName = Event.TgtDCSUnit:getName() Event.TgtDCSUnitName = Event.TgtDCSUnit:getName()
Event.TgtUnitName = Event.TgtDCSUnitName Event.TgtUnitName = Event.TgtDCSUnitName
Event.TgtUnit = STATIC:FindByName( Event.TgtDCSUnitName, false ) Event.TgtUnit = STATIC:FindByName( Event.TgtDCSUnitName, false )
Event.TgtCoalition = Event.TgtDCSUnit:getCoalition() Event.TgtCoalition = Event.TgtDCSUnit:getCoalition()
Event.TgtCategory = Event.TgtDCSUnit:getDesc().category Event.TgtCategory = Event.TgtDCSUnit:getDesc().category
Event.TgtTypeName = Event.TgtDCSUnit:getTypeName() Event.TgtTypeName = Event.TgtDCSUnit:getTypeName()
--]] else
-- Same as for Event Initiator above 2.7 issue Event.TgtDCSUnitName = string.format("No target object for Event ID %s", tostring(Event.id))
Event.TgtDCSUnit = Event.target Event.TgtUnitName = Event.TgtDCSUnitName
local ID=Event.initiator.id_ Event.TgtUnit = nil
Event.TgtDCSUnitName = string.format("Ejected Pilot ID %s", tostring(ID)) Event.TgtCoalition = 0
Event.TgtUnitName = Event.TgtDCSUnitName Event.TgtCategory = 0
--Event.TgtUnit = STATIC:FindByName( Event.TgtDCSUnitName, false ) if Event.id == 6 then
Event.TgtCoalition = Event.IniCoalition Event.TgtTypeName = "Ejected Pilot"
Event.TgtCategory = Event.IniCategory Event.TgtDCSUnitName = string.format("Ejected Pilot ID %s", tostring(Event.IniDCSUnitName))
Event.TgtTypeName = "Ejected Pilot" Event.TgtUnitName = Event.TgtDCSUnitName
elseif Event.id == 33 then
Event.TgtTypeName = "Ejection Seat"
Event.TgtDCSUnitName = string.format("Ejection Seat ID %s", tostring(Event.IniDCSUnitName))
Event.TgtUnitName = Event.TgtDCSUnitName
else
Event.TgtTypeName = "Static"
end
end
end end
if Event.TgtObjectCategory == Object.Category.SCENERY then if Event.TgtObjectCategory == Object.Category.SCENERY then