summaryrefslogtreecommitdiff
path: root/mesecons/legacy.lua
blob: 6d8ccca08042407e0bb95e3e4844d2e8510e61ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
-- Ugly hack to prevent breaking compatibility with other mods
-- Just remove the following two functions to delete the hack, to be done when other mods have updated
function mesecon.receptor_on(self, pos, rules)
	if (self.receptor_on) then
		print("[Mesecons] Warning: A mod with mesecon support called mesecon:receptor_on.")
		print("[Mesecons]          If you are the programmer of this mod, please update it ")
		print("[Mesecons]          to use mesecon.receptor_on instead. mesecon:* is deprecated")
		print("[Mesecons]          Otherwise, please make sure you're running the latest version")
		print("[Mesecons]          of that mod and inform the mod creator.")
	else
		rules = pos
		pos = self
	end
	mesecon.queue:add_action(pos, "receptor_on", {rules}, nil, rules)
end

function mesecon.receptor_off(self, pos, rules)
	if (self.receptor_off) then
		print("[Mesecons] Warning: A mod with mesecon support called mesecon:receptor_off.")
		print("[Mesecons]          If you are the programmer of this mod, please update it ")
		print("[Mesecons]          to use mesecon.receptor_off instead. mesecon:* is deprecated")
		print("[Mesecons]          Otherwise, please make sure you're running the latest version")
		print("[Mesecons]          of that mod and inform the mod creator.")
	else
		rules = pos
		pos = self
	end
	mesecon.queue:add_action(pos, "receptor_off", {rules}, nil, rules)
end