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)
committerparamat <mat.gregory@virginmedia.com>
Sat, 11 Nov 2017 21:34:30 +0000 (21:34 +0000)
mods/creative/init.lua

index 09dc2dc7da13b89bc695b57fadf841b2d149ba94..ef190b8dc1e3a078dcffdfff11fbe51f8ba8fd5c 100644 (file)
@@ -47,7 +47,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