aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Pérez-Cerezo <gabriel@gpcf.eu>2017-08-31 13:00:22 +0200
committerGabriel Pérez-Cerezo <gabriel@gpcf.eu>2017-08-31 13:00:22 +0200
commit31eb128523f8e7baed31ee477dfba6fdd3003d80 (patch)
treed5fbcd6d08539f2abf9165d1953cd822928151c4
parent6053422cf292995b2a004ca0a21c640505ef32bb (diff)
downloadfarebox-31eb128523f8e7baed31ee477dfba6fdd3003d80.zip
farebox-31eb128523f8e7baed31ee477dfba6fdd3003d80.tar.gz
farebox-31eb128523f8e7baed31ee477dfba6fdd3003d80.tar.bz2
Fixed bug with rotations
-rw-r--r--faregate.lua2
-rw-r--r--init.lua8
2 files changed, 8 insertions, 2 deletions
diff --git a/faregate.lua b/faregate.lua
index a065002..e5170bd 100644
--- a/faregate.lua
+++ b/faregate.lua
@@ -8,6 +8,7 @@ minetest.register_node("farebox:faregate", {
},
drawtype = "nodebox",
paramtype = "light",
+ paramtype2 = "facedir",
description = "Faregate",
node_box = {
type = "fixed",
@@ -49,6 +50,7 @@ minetest.register_node("farebox:faregate_open", {
tiles = {
"default_steel_block.png"
},
+ paramtype2 = "facedir",
description = "Open Faregate",
mesecons = {
effector = {
diff --git a/init.lua b/init.lua
index 3b0c84a..f8f51a7 100644
--- a/init.lua
+++ b/init.lua
@@ -36,12 +36,16 @@ farebox.rules =
{x=0, y=2, z=0}}
function farebox.open_faregate(pos)
- minetest.swap_node(pos, {name="farebox:faregate_open"})
+ node = minetest.get_node(pos)
+ node.name = "farebox:faregate_open"
+ minetest.swap_node(pos, node)
minetest.sound_play("doors_steel_door_open",
{pos = pos, gain = 0.3, max_hear_distance = 10})
end
function farebox.close_faregate(pos)
- minetest.swap_node(pos, {name="farebox:faregate"})
+ node = minetest.get_node(pos)
+ node.name = "farebox:faregate"
+ minetest.swap_node(pos, node)
minetest.sound_play("doors_steel_door_close",
{pos = pos, gain = 0.3, max_hear_distance = 10})
end