Closed Quax456 closed 8 years ago
It seems there are some timing issues with those event handlers. There are situation where this snippet:
if (event.id == world.event.S_EVENT_DEAD or
event.id == world.event.S_EVENT_CRASH or
event.id == world.event.S_EVENT_ENGINE_SHUTDOWN) and
event.initiator ~= nil then
local unit = event.initiator
local group = unit:getGroup()
throws a error because it can't access getGroup()
on a nil object. This means event.initiator
becomes nil
in the timeframe between two lines. Maybe pulling the group name directly on the event into a different variable and working with that is a option.
Regarding ground units: It actually should not. The handler checks with
local flight = gcicap.Flight.getFlight(group:getName())
-- check if we manage this group
if flight then
...
end
if we don't find a flight for this group we won't do anything.
I think this issue is the same as #10.
Fixed with 1ce3b5c98ecdb518a9f9b424a4d6c3d7d9493ae6 until proven otherwise.
Your despawnhandler has some havy disadvanteges.