Skip to content

Commit

Permalink
Fix variable scope violation (#233)
Browse files Browse the repository at this point in the history
closes #230
  • Loading branch information
AKryukov92 authored and ClobberXD committed Nov 11, 2018
1 parent df0adb4 commit bdf0bbe
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions mods/doors/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -325,18 +325,19 @@ function doors.register(name, def)
z = pos.z + ref[dir + 1].z,
}

local dname = name
-- If steel doors are placed, append tname to place coloured team-doors instead
if name == "doors:door_steel" then
name = name .. "_" .. tname -- e.g. "doors:door_steel_red"
dname = name .. "_" .. tname -- e.g. "doors:door_steel_red"
end

local state = 0
if minetest.get_item_group(minetest.get_node(aside).name, "door") == 1 then
state = state + 2
minetest.set_node(pos, {name = name .. "_b", param2 = dir})
minetest.set_node(pos, {name = dname .. "_b", param2 = dir})
minetest.set_node(above, {name = "doors:hidden", param2 = (dir + 3) % 4})
else
minetest.set_node(pos, {name = name .. "_a", param2 = dir})
minetest.set_node(pos, {name = dname .. "_a", param2 = dir})
minetest.set_node(above, {name = "doors:hidden", param2 = dir})
end

Expand Down

0 comments on commit bdf0bbe

Please sign in to comment.