From 31eb128523f8e7baed31ee477dfba6fdd3003d80 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gabriel=20P=C3=A9rez-Cerezo?= <gabriel@gpcf.eu>
Date: Thu, 31 Aug 2017 13:00:22 +0200
Subject: Fixed bug with rotations

---
 init.lua | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

(limited to 'init.lua')

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
-- 
cgit v1.2.3