From: raymoo Date: Mon, 2 Oct 2017 01:32:01 +0000 (-0700) Subject: Creative: Make the placenode registration check for non-player placers X-Git-Tag: 5.0.0~149 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=8b5ad0f02813cefada44d93d31b2556d8277b5bf;p=oweals%2Fminetest_game.git Creative: Make the placenode registration check for non-player placers --- diff --git a/mods/creative/init.lua b/mods/creative/init.lua index 09dc2dc7..ef190b8d 100644 --- a/mods/creative/init.lua +++ b/mods/creative/init.lua @@ -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