core/modulemanager.lua
changeset 4643 9008fc396fb1
parent 4642 c1602c07d14d
child 4652 9d24bc503621
--- a/core/modulemanager.lua	Sat Apr 21 20:09:03 2012 +0100
+++ b/core/modulemanager.lua	Sat Apr 21 20:37:06 2012 +0100
@@ -183,8 +183,10 @@
 				log("warn", "mod_%s: Setting module.host = '*' deprecated, call module:set_global() instead", module_name);
 				api_instance:set_global();
 			end
-		else
-			modulemap[host][module_name] = pluginenv;
+			if host ~= api_instance.host and module_has_method(pluginenv, "add_host") then
+				-- Now load the module again onto the host it was originally being loaded on
+				do_load_module(host, module_name);
+			end
 		end
 	end
 	if not ok then