Add nil check in doors_toggle (#126)
Add nil check to prevent errors xdecor caused in combination with pkarcs_doors.
This commit is contained in:
parent
5b0b4f3b56
commit
841a033983
@ -9,7 +9,8 @@ local function door_toggle(pos_actuator, pos_door, player)
|
|||||||
local player_name = player:get_player_name()
|
local player_name = player:get_player_name()
|
||||||
local actuator = minetest.get_node(pos_actuator)
|
local actuator = minetest.get_node(pos_actuator)
|
||||||
local door = doors.get(pos_door)
|
local door = doors.get(pos_door)
|
||||||
|
if not door then return end
|
||||||
|
|
||||||
if actuator.name:sub(-4) == "_off" then
|
if actuator.name:sub(-4) == "_off" then
|
||||||
minetest.set_node(pos_actuator,
|
minetest.set_node(pos_actuator,
|
||||||
{name = actuator.name:gsub("_off", "_on"), param2 = actuator.param2})
|
{name = actuator.name:gsub("_off", "_on"), param2 = actuator.param2})
|
||||||
|
Loading…
Reference in New Issue
Block a user