aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2017-05-18 15:57:58 -0400
committerGitHub <noreply@github.com>2017-05-18 15:57:58 -0400
commit3ee673da2114fd9fcf3cfd42200f853ffa2530ef (patch)
tree29b5f3bc292ab5102de1554975c55efee7468b62
parent1979be782088e44ee5fb62b9f1ebe6d93109f14a (diff)
parent85a74f32ac56859f0dfe0962bf8cc2d323334733 (diff)
downloadcurrency-3ee673da2114fd9fcf3cfd42200f853ffa2530ef.tar.gz
currency-3ee673da2114fd9fcf3cfd42200f853ffa2530ef.tar.bz2
currency-3ee673da2114fd9fcf3cfd42200f853ffa2530ef.zip
Merge pull request #9 from AntumDeluge/pipeworks_fixes
Test for global 'pipeworks' before calling
-rw-r--r--shop.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/shop.lua b/shop.lua
index b5d2351..301a08c 100644
--- a/shop.lua
+++ b/shop.lua
@@ -37,6 +37,8 @@ default.shop.formspec = {
end,
}
+local have_pipeworks = minetest.global_exists("pipeworks")
+
default.shop.check_privilege = function(listname,playername,meta)
--[[if listname == "pl1" then
if playername ~= meta:get_string("pl1") then
@@ -108,9 +110,9 @@ minetest.register_node("currency:shop", {
inv:set_size("stock", 3*2)
inv:set_size("owner_wants", 3*2)
inv:set_size("owner_gives", 3*2)
- if minetest.get_modpath("pipeworks") then pipeworks.after_place(pos) end
+ if have_pipeworks then pipeworks.after_place(pos) end
end,
- after_dig_node = (pipeworks and pipeworks.after_dig),
+ after_dig_node = (have_pipeworks and pipeworks and pipeworks.after_dig),
tube = {
insert_object = function(pos, node, stack, direction)
local meta = minetest.get_meta(pos)