diff options
Diffstat (limited to 'drive_entity.lua')
-rw-r--r-- | drive_entity.lua | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/drive_entity.lua b/drive_entity.lua index ecf5bf8..e1e448b 100644 --- a/drive_entity.lua +++ b/drive_entity.lua @@ -580,18 +580,12 @@ function celevator.drives.entity.movedoors(drivepos,direction) local carpos = vector.add(origin,vector.new(0,apos,0)) local carnode = minetest.get_node(carpos) local hwdoorpos = vector.add(carpos,vector.rotate_around_axis(minetest.fourdir_to_dir(carnode.param2),vector.new(0,1,0),math.pi)) - if direction == "open" and minetest.get_item_group(minetest.get_node(hwdoorpos).name,"_celevator_hwdoor_root") == 1 then - celevator.doors.hwopen(hwdoorpos) + if direction == "open" and (minetest.get_item_group(minetest.get_node(hwdoorpos).name,"_celevator_hwdoor_root") == 1 or drivemeta:get_string("doorstate") == "closing") then + celevator.doors.hwopen(hwdoorpos,drivepos) drivemeta:set_string("doorstate","opening") - minetest.after(math.pi+0.5,function() - minetest.get_meta(drivepos):set_string("doorstate","open") - end) elseif direction == "close" and minetest.get_node(hwdoorpos).name == "celevator:hwdoor_placeholder" then - celevator.doors.hwclose(hwdoorpos) + celevator.doors.hwclose(hwdoorpos,drivepos) drivemeta:set_string("doorstate","closing") - minetest.after((math.pi/0.66)+0.5,function() - minetest.get_meta(drivepos):set_string("doorstate","closed") - end) end end |