Diff

core/modulemanager.lua @ 4893:98ff89ab5d1d

moduleapi, modulemanager: Re-structure module.event_handlers so that the same handler can harmlessly handle multiple events (thanks Zash)
author Matthew Wild <mwild1@gmail.com>
date Fri, 18 May 2012 23:53:02 +0100
parent 4883:b798d59919b1
child 4896:27cda15104f2
line wrap: on
line diff
--- a/core/modulemanager.lua	Fri May 18 04:24:33 2012 +0100
+++ b/core/modulemanager.lua	Fri May 18 23:53:02 2012 +0100
@@ -91,8 +91,8 @@
 		end
 	end
 	
-	for handler, event in pairs(mod.module.event_handlers) do
-		event.object.remove_handler(event.name, handler);
+	for event, data in pairs(mod.module.event_handlers) do
+		data.object.remove_handler(event, data.handler);
 	end
 	
 	if mod.module.items then -- remove items