Update Event.lua workaround for 2.7

Same as for Event 31
This commit is contained in:
Applevangelist 2021-04-15 13:02:59 +02:00 committed by GitHub
parent 4b8802af37
commit b232a5da37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -254,7 +254,7 @@ EVENTS = {
-- Note that at the beginning of each field description, there is an indication which field will be populated depending on the object type involved in the Event:
--
-- * A (Object.Category.)UNIT : A UNIT object type is involved in the Event.
-- * A (Object.Category.)STATIC : A STATIC object type is involved in the Event.µ
-- * A (Object.Category.)STATIC : A STATIC object type is involved in the Event.µ
--
-- @type EVENTDATA
-- @field #number id The identifier of the event.
@ -1115,6 +1115,8 @@ function EVENT:onEvent( Event )
end
if Event.TgtObjectCategory == Object.Category.STATIC then
BASE:T({Event = Event})
--[[
Event.TgtDCSUnit = Event.target
Event.TgtDCSUnitName = Event.TgtDCSUnit:getName()
Event.TgtUnitName = Event.TgtDCSUnitName
@ -1122,6 +1124,16 @@ function EVENT:onEvent( Event )
Event.TgtCoalition = Event.TgtDCSUnit:getCoalition()
Event.TgtCategory = Event.TgtDCSUnit:getDesc().category
Event.TgtTypeName = Event.TgtDCSUnit:getTypeName()
--]]
-- Same as for Event Initiator above 2.7 issue
Event.TgtDCSUnit = Event.target
local ID=Event.initiator.id_
Event.TgtDCSUnitName = string.format("Ejected Pilot ID %s", tostring(ID))
Event.TgtUnitName = Event.TgtDCSUnitName
--Event.TgtUnit = STATIC:FindByName( Event.TgtDCSUnitName, false )
Event.TgtCoalition = Event.IniCoalition
Event.TgtCategory = Event.IniCategory
Event.TgtTypeName = "Ejected Pilot"
end
if Event.TgtObjectCategory == Object.Category.SCENERY then