Skip to content
Snippets Groups Projects
Unverified Commit 841a0339 authored by Elias Fleckenstein's avatar Elias Fleckenstein Committed by GitHub
Browse files

Add nil check in doors_toggle (#126)

Add nil check to prevent errors xdecor caused in combination with pkarcs_doors.
parent 5b0b4f3b
No related branches found
No related tags found
No related merge requests found
......@@ -9,7 +9,8 @@ local function door_toggle(pos_actuator, pos_door, player)
local player_name = player:get_player_name()
local actuator = minetest.get_node(pos_actuator)
local door = doors.get(pos_door)
if not door then return end
if actuator.name:sub(-4) == "_off" then
minetest.set_node(pos_actuator,
{name = actuator.name:gsub("_off", "_on"), param2 = actuator.param2})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment