Doors: Ignore permission check if player parameter is omitted
authorupsilon <upsilon@langg.net>
Mon, 17 Apr 2017 10:56:27 +0000 (12:56 +0200)
committerparamat <mat.gregory@virginmedia.com>
Thu, 20 Apr 2017 18:54:27 +0000 (19:54 +0100)
As written in game_api.txt.

mods/doors/init.lua

index a1bfc092d28da3a67a31f64545275df5b88ce3b3..05aa3e2f7c1380706b246f95b18e127107fbea90 100644 (file)
@@ -150,7 +150,7 @@ function _doors.door_toggle(pos, node, clicker)
 
        replace_old_owner_information(pos)
 
-       if not default.can_interact_with_node(clicker, pos) then
+       if clicker and not default.can_interact_with_node(clicker, pos) then
                return false
        end
 
@@ -530,7 +530,7 @@ function _doors.trapdoor_toggle(pos, node, clicker)
 
        replace_old_owner_information(pos)
 
-       if not default.can_interact_with_node(clicker, pos) then
+       if clicker and not default.can_interact_with_node(clicker, pos) then
                return false
        end