summaryrefslogtreecommitdiff
path: root/drive_entity.lua
diff options
context:
space:
mode:
authorcheapie <no-email-for-you@example.com>2024-09-15 12:38:00 -0500
committercheapie <no-email-for-you@example.com>2024-09-15 12:38:00 -0500
commit00fb4e2e14b39853fe593cd843daf3f4c57675ee (patch)
treecf2a3b70cb8ad6fe6d587338e1ef571303c4905c /drive_entity.lua
parent873001197a25eaaeefcaea91ebddd424301be809 (diff)
downloadcelevator-00fb4e2e14b39853fe593cd843daf3f4c57675ee.tar
celevator-00fb4e2e14b39853fe593cd843daf3f4c57675ee.tar.gz
celevator-00fb4e2e14b39853fe593cd843daf3f4c57675ee.tar.bz2
celevator-00fb4e2e14b39853fe593cd843daf3f4c57675ee.tar.xz
celevator-00fb4e2e14b39853fe593cd843daf3f4c57675ee.zip
Shorten long lines
Diffstat (limited to 'drive_entity.lua')
-rw-r--r--drive_entity.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/drive_entity.lua b/drive_entity.lua
index ecbabdf..ae72bca 100644
--- a/drive_entity.lua
+++ b/drive_entity.lua
@@ -655,7 +655,8 @@ function celevator.drives.entity.movedoors(drivepos,direction,nudge)
local carpos = vector.add(origin,vector.new(0,apos,0))
local carnode = celevator.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(celevator.get_node(hwdoorpos).name,"_celevator_hwdoor_root") == 1 or drivemeta:get_string("doorstate") == "closing") then
+ local isroot = minetest.get_item_group(celevator.get_node(hwdoorpos).name,"_celevator_hwdoor_root") == 1
+ if direction == "open" and (isroot or drivemeta:get_string("doorstate") == "closing") then
celevator.doors.hwopen(hwdoorpos,drivepos)
drivemeta:set_string("doorstate","opening")
elseif direction == "close" and celevator.get_node(hwdoorpos).name == "celevator:hwdoor_placeholder" then