Small bugfix

Forgot to add a check - if it has a parent or not
This commit is contained in:
Robert Jelic
2022-08-28 20:27:07 +02:00
parent 18601d54f7
commit 001e8c4ef6

View File

@@ -588,12 +588,14 @@ return function(name)
self:registerEvent("mouse_drag", v)
end
end
self.parent:addEvent("mouse_drag", self)
activeEvents["mouse_drag"] = true
self.parent:addEvent("mouse_click", self)
activeEvents["mouse_click"] = true
self.parent:addEvent("mouse_up", self)
activeEvents["mouse_up"] = true
if(self.parent~=nil)then
self.parent:addEvent("mouse_drag", self)
activeEvents["mouse_drag"] = true
self.parent:addEvent("mouse_click", self)
activeEvents["mouse_click"] = true
self.parent:addEvent("mouse_up", self)
activeEvents["mouse_up"] = true
end
return self
end;