Creative: Make the placenode registration check for non-player placers
authorraymoo <raymoo@users.noreply.github.com>
Mon, 2 Oct 2017 01:32:01 +0000 (18:32 -0700)
committersfan5 <sfan5@live.de>
Sun, 19 Nov 2017 22:03:38 +0000 (23:03 +0100)
mods/creative/init.lua

index a33475dd98ebf5a9fd284cd7de6d78fe30515dcb..2a590e34f7ffa0be9526762f2bdf25697df5bd54 100644 (file)
@@ -40,7 +40,9 @@ end
 
 -- Unlimited node placement
 minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack)
-       return creative.is_enabled_for(placer:get_player_name())
+       if placer and placer:is_player() then
+               return creative.is_enabled_for(placer:get_player_name())
+       end
 end)
 
 -- Don't pick up if the item is already in the inventory