mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Fixes for DEAD event and extra nil checks
This commit is contained in:
@@ -90,6 +90,7 @@
|
||||
UNIT = {
|
||||
ClassName="UNIT",
|
||||
UnitName=nil,
|
||||
GroupName=nil,
|
||||
}
|
||||
|
||||
|
||||
@@ -110,11 +111,17 @@ UNIT = {
|
||||
function UNIT:Register( UnitName )
|
||||
|
||||
-- Inherit CONTROLLABLE.
|
||||
local self = BASE:Inherit( self, CONTROLLABLE:New( UnitName ) )
|
||||
local self = BASE:Inherit( self, CONTROLLABLE:New( UnitName ) ) --#UNIT
|
||||
|
||||
-- Set unit name.
|
||||
self.UnitName = UnitName
|
||||
|
||||
local unit=Unit.getByName(self.UnitName)
|
||||
|
||||
if unit then
|
||||
self.GroupName=unit:getGroup():getName()
|
||||
end
|
||||
|
||||
-- Set event prio.
|
||||
self:SetEventPriority( 3 )
|
||||
|
||||
|
||||
Reference in New Issue
Block a user