diff options
author | cheapie <no-email-for-you@example.com> | 2024-04-12 20:48:19 -0500 |
---|---|---|
committer | cheapie <no-email-for-you@example.com> | 2024-04-12 20:48:19 -0500 |
commit | 23826516cac0cfa6ab3d50828862544cfe1d9f6b (patch) | |
tree | 2f86377630871b32db747a1b655b4b605a5c7a01 /controller.lua | |
parent | dab488531aabe5918fcd965299c71b8e239c5ace (diff) | |
download | celevator-23826516cac0cfa6ab3d50828862544cfe1d9f6b.tar celevator-23826516cac0cfa6ab3d50828862544cfe1d9f6b.tar.gz celevator-23826516cac0cfa6ab3d50828862544cfe1d9f6b.tar.bz2 celevator-23826516cac0cfa6ab3d50828862544cfe1d9f6b.tar.xz celevator-23826516cac0cfa6ab3d50828862544cfe1d9f6b.zip |
Add COP
Still more things I want to add to it, but it works for now.
Should show up in existing cars (once they do something for the first time, for now)
Diffstat (limited to 'controller.lua')
-rw-r--r-- | controller.lua | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/controller.lua b/controller.lua index a36dee1..884f620 100644 --- a/controller.lua +++ b/controller.lua @@ -62,6 +62,8 @@ local function ondestruct(pos) end celevator.controller.equeue[minetest.hash_node_position(pos)] = nil celevator.storage:set_string("controller_equeue",minetest.serialize(celevator.controller.equeue)) + local carid = minetest.get_meta(pos):get_int("carid") + if carid ~= 0 then celevator.storage:set_string(string.format("car%d",carid),"") end end local function onrotate(controllerpos,node,user,mode,new_param2) @@ -490,6 +492,10 @@ function celevator.controller.finish(pos,mem,changedinterrupts) celevator.lantern.setlight(lantern.pos,"down",newlanterns[lantern.landing] == "down") end end + meta:set_string("copformspec",mem.copformspec) + if mem.copformspec ~= oldmem.copformspec and drivetype then + minetest.after(0.25,celevator.drives[drivetype].updatecopformspec,drivepos) + end meta:set_string("mem",minetest.serialize(mem)) if node.name == "celevator:controller_open" then meta:set_string("formspec",mem.formspec or "") end meta:set_string("formspec_hidden",mem.formspec or "") |