Permalink
Browse files

Doors: Avoid crash on nil player in 'can dig door'

  • Loading branch information...
paramat committed Feb 2, 2018
1 parent 12f1703 commit d5907d5f1e5dedb7ecc7a20e740e971403cf0f5a
Showing with 1 addition and 6 deletions.
  1. +1 −6 mods/doors/init.lua
View
@@ -203,12 +203,7 @@ end
local function can_dig_door(pos, digger)
replace_old_owner_information(pos)
if default.can_interact_with_node(digger, pos) then
return true
else
minetest.record_protection_violation(pos, digger:get_player_name())
return false
end
return default.can_interact_with_node(digger, pos)
end
function doors.register(name, def)

3 comments on commit d5907d5

@alexerate

This comment has been minimized.

alexerate replied Feb 8, 2018

why not use if not digger then return false end instead of removing the minetest.record_protection_violation(pos, digger:get_player_name()) ?

record_protection_violation is used by some mods and can't be handled now.

@paramat

This comment has been minimized.

Member

paramat replied Feb 8, 2018

@alexerate

This comment has been minimized.

alexerate replied Feb 9, 2018

Correct me if i'm wrong, but since you removed minetest.record_protection_violation, we can't use minetest.register_on_protection_violation to catch protection event of locked doors.

Please sign in to comment.