aboutsummaryrefslogtreecommitdiff
path: root/games/minimal
diff options
context:
space:
mode:
Diffstat (limited to 'games/minimal')
-rw-r--r--games/minimal/mods/default/init.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/games/minimal/mods/default/init.lua b/games/minimal/mods/default/init.lua
index fcdf93547..bfd938211 100644
--- a/games/minimal/mods/default/init.lua
+++ b/games/minimal/mods/default/init.lua
@@ -1270,7 +1270,9 @@ minetest.register_node("default:chest_locked", {
sounds = default.node_sound_wood_defaults(),
after_place_node = function(pos, placer)
local meta = minetest.get_meta(pos)
- meta:set_string("owner", placer:get_player_name() or "")
+ local pname =
+ placer and placer:get_player_name() or ""
+ meta:set_string("owner", pname)
meta:set_string("infotext", "Locked Chest (owned by "..
meta:get_string("owner")..")")
end,