From f21af8da9c1ca72b720fc8c2249baa349af84a47 Mon Sep 17 00:00:00 2001 From: darkrose Date: Sat, 21 Jul 2012 03:12:38 +1000 Subject: Handle nil placer as it might occur when using minetest.env:place_node. (Uberi) --- builtin/item.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'builtin') diff --git a/builtin/item.lua b/builtin/item.lua index f85bd7223..756c1de6a 100644 --- a/builtin/item.lua +++ b/builtin/item.lua @@ -148,7 +148,7 @@ function minetest.item_place_node(itemstack, placer, pointed_thing) local dir = {x = under.x - above.x, y = under.y - above.y, z = under.z - above.z} newnode.param2 = minetest.dir_to_wallmounted(dir) -- Calculate the direction for furnaces and chests and stuff - elseif def.paramtype2 == 'facedir' then + elseif def.paramtype2 == 'facedir' and placer then local playerpos = placer:getpos() local dir = {x = pos.x - playerpos.x, y = pos.y - playerpos.y, z = pos.z - playerpos.z} newnode.param2 = minetest.dir_to_facedir(dir) -- cgit v1.2.3 bmit' value='switch'/> modified minetest for gpcfs purposesgpcf
aboutsummaryrefslogtreecommitdiff
path: root/games/minimal/mods/errorhandler_test
diff options
context:
space:
mode:
authorrubenwardy <rubenwardy@gmail.com>2017-02-19 20:57:46 +0000
committerAuke Kok <sofar+github@foo-projects.org>2017-02-22 10:14:12 -0800
commit2d1fca51e975a01f84fa3fd9b266435316fbe548 (patch)
tree7a22fcbe40d0c39ada653dd31f20b284496a1ade /games/minimal/mods/errorhandler_test
parent01b2d2c66c9095341554400ba67505b137ec1d86 (diff)
downloadminetest-2d1fca51e975a01f84fa3fd9b266435316fbe548.tar.gz
minetest-2d1fca51e975a01f84fa3fd9b266435316fbe548.tar.bz2
minetest-2d1fca51e975a01f84fa3fd9b266435316fbe548.zip
Fix wrong meta key in item meta on ItemStack construction
Diffstat (limited to 'games/minimal/mods/errorhandler_test')
0 files changed, 0 insertions, 0 deletions