Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix compatibility with not yet updated mods that use mesecon:receptor_*
- Loading branch information
Jeija
committed
Nov 22, 2014
1 parent
d19e975
commit a550323
Showing
3 changed files
with
32 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,29 @@ | ||
function mesecon:receptor_on(pos, rules) | ||
mesecon.receptor_on(pos, rules) | ||
-- 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(pos, rules) | ||
mesecon.receptor_off(pos, rules) | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters