Skip to content

Commit

Permalink
Small bugfix
Browse files Browse the repository at this point in the history
Forgot to add a check - if it has a parent or not
  • Loading branch information
NoryiE committed Aug 28, 2022
1 parent 18601d5 commit 001e8c4
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Basalt/Object.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 001e8c4

Please sign in to comment.