door detection is now more versatile

This commit is contained in:
Sokomine 2017-12-25 12:46:42 +01:00
parent 661919aaaf
commit af581a0e81

@ -24,6 +24,7 @@
Changelog: Changelog:
24.12.17 - Added support for localization through intllib. 24.12.17 - Added support for localization through intllib.
Added localization for German (de). Added localization for German (de).
Door opening/closing can now handle more general doors.
17.07.17 - Added more detailled licence information. 17.07.17 - Added more detailled licence information.
TNT and DungeonMasters ought to leave travelnets and elevators untouched now. TNT and DungeonMasters ought to leave travelnets and elevators untouched now.
Added function to register elevator doors. Added function to register elevator doors.
@ -593,8 +594,7 @@ travelnet.open_close_door = function( pos, player, mode )
-- at least for homedecor, same facedir would mean "door closed" -- at least for homedecor, same facedir would mean "door closed"
-- do not close the elevator door if it is already closed -- do not close the elevator door if it is already closed
if( mode==1 and ( door_node.name == 'travelnet:elevator_door_glass_closed' if( mode==1 and ( string.sub( door_node.name, -7 ) == '_closed'
or door_node.name == 'travelnet:elevator_door_steel_closed'
-- handle doors that change their facedir -- handle doors that change their facedir
or ( door_node.param2 == this_node.param2 or ( door_node.param2 == this_node.param2
and door_node.name ~= 'travelnet:elevator_door_glass_open' and door_node.name ~= 'travelnet:elevator_door_glass_open'
@ -602,8 +602,7 @@ travelnet.open_close_door = function( pos, player, mode )
return; return;
end end
-- do not open the doors if they are already open (works only on elevator-doors; not on doors in general) -- do not open the doors if they are already open (works only on elevator-doors; not on doors in general)
if( mode==2 and ( door_node.name == 'travelnet:elevator_door_glass_open' if( mode==2 and ( string.sub( door_node.name, -5 ) == '_open'
or door_node.name == 'travelnet:elevator_door_steel_open'
-- handle doors that change their facedir -- handle doors that change their facedir
or ( door_node.param2 ~= this_node.param2 or ( door_node.param2 ~= this_node.param2
and door_node.name ~= 'travelnet:elevator_door_glass_closed' and door_node.name ~= 'travelnet:elevator_door_glass_closed'