mirror of
https://codeberg.org/minenux/minetest-mod-xdecor
synced 2023-10-20 21:43:39 -07:00
Fix passing invalid player object (#94)
This commit is contained in:
parent
9b5bdc1b1a
commit
e36839e178
@ -6,6 +6,7 @@ local plate = {}
|
||||
screwdriver = screwdriver or {}
|
||||
|
||||
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)
|
||||
|
||||
@ -13,14 +14,14 @@ local function door_toggle(pos_actuator, pos_door, player)
|
||||
minetest.set_node(pos_actuator,
|
||||
{name=actuator.name:gsub("_off", "_on"), param2=actuator.param2})
|
||||
end
|
||||
door:open(player)
|
||||
door:open(player_name)
|
||||
|
||||
minetest.after(2, function()
|
||||
if minetest.get_node(pos_actuator).name:sub(-3) == "_on" then
|
||||
minetest.set_node(pos_actuator,
|
||||
{name=actuator.name, param2=actuator.param2})
|
||||
end
|
||||
door:close(player)
|
||||
door:close(player_name)
|
||||
end)
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user