Fixes for DEAD event and extra nil checks

This commit is contained in:
Applevangelist
2022-05-04 10:25:50 +02:00
parent 6e8edd95ec
commit 8099847e29
8 changed files with 274 additions and 183 deletions

View File

@@ -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 )