summaryrefslogtreecommitdiff
path: root/doors.lua
diff options
context:
space:
mode:
authorcheapie <no-email-for-you@example.com>2025-03-15 13:02:27 -0500
committercheapie <no-email-for-you@example.com>2025-03-15 13:02:27 -0500
commitfeea683ef8d8a7a4c8be692e7ad1749904b2921a (patch)
treeb8bf8646cdfc42b235ee3d77b85a8b4cf2628d04 /doors.lua
parent9adad1127871b11ec541edf52de7914903359f43 (diff)
downloadcelevator-feea683ef8d8a7a4c8be692e7ad1749904b2921a.tar
celevator-feea683ef8d8a7a4c8be692e7ad1749904b2921a.tar.gz
celevator-feea683ef8d8a7a4c8be692e7ad1749904b2921a.tar.bz2
celevator-feea683ef8d8a7a4c8be692e7ad1749904b2921a.tar.xz
celevator-feea683ef8d8a7a4c8be692e7ad1749904b2921a.zip
Add glass-back car
Diffstat (limited to 'doors.lua')
-rw-r--r--doors.lua11
1 files changed, 7 insertions, 4 deletions
diff --git a/doors.lua b/doors.lua
index 4443c5d..3d12122 100644
--- a/doors.lua
+++ b/doors.lua
@@ -271,7 +271,8 @@ function celevator.doors.hwopen(pos,drivepos)
pmeta:set_string("data",minetest.serialize(hwdoors_moving[hash]))
pmeta:set_string("state","opening")
local carpos = vector.add(pos,fdir)
- if celevator.get_node(carpos).name == "celevator:car_000" then
+ local carndef = minetest.registered_nodes[celevator.get_node(carpos).name] or {}
+ if carndef._root then
celevator.doors.caropen(carpos)
end
elseif hwdoors_moving[hash].direction == "close" then
@@ -280,7 +281,8 @@ function celevator.doors.hwopen(pos,drivepos)
celevator.storage:set_string("hwdoors_moving",minetest.serialize(hwdoors_moving))
local fdir = minetest.fourdir_to_dir(hwdoors_moving[hash].param2)
local carpos = vector.add(pos,fdir)
- if celevator.get_node(carpos).name == "celevator:car_000" then
+ local carndef = minetest.registered_nodes[celevator.get_node(carpos).name] or {}
+ if carndef._root then
celevator.doors.caropen(carpos)
end
minetest.set_node(pos,{name="celevator:hwdoor_placeholder",param2=hwdoors_moving[hash].param2})
@@ -301,7 +303,8 @@ function celevator.doors.hwclose(pos,drivepos,nudge)
if state ~= "open" then return end
local fdir = minetest.fourdir_to_dir(celevator.get_node(pos).param2)
local carpos = vector.add(pos,fdir)
- if celevator.get_node(carpos).name == "celevator:car_000" then
+ local carndef = minetest.registered_nodes[celevator.get_node(carpos).name] or {}
+ if carndef._root then
celevator.doors.carclose(carpos,nudge)
end
local data = minetest.deserialize(pmeta:get_string("data"))
@@ -619,7 +622,7 @@ end
minetest.register_abm({
label = "Respawn car doors",
- nodenames = {"celevator:car_000"},
+ nodenames = {"group:_celevator_car_root"},
interval = 1,
chance = 1,
action = function(pos)