From 8e03d7ded6441b26e9d44102c0cd2ee39f9e90bc Mon Sep 17 00:00:00 2001
From: RealBadAngel <mk@realbadangel.pl>
Date: Sun, 30 Jun 2013 07:12:02 +0200
Subject: [PATCH] Sync with indev branch, bump version to 0.4.7

---
 technic/constructor.lua |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/technic/constructor.lua b/technic/constructor.lua
index 58d2dad..2b031e5 100644
--- a/technic/constructor.lua
+++ b/technic/constructor.lua
@@ -283,6 +283,22 @@
 				stack1[1]:take_item()
 				inv:set_stack(slot_name, 1, stack1[1])
 			elseif def.type == "craft" then
+				if def.on_place then
+					-- print("deploy_node: item has on_place. trying...")
+					local ok, stk = pcall(def.on_place, stack1[1], nil, {
+						-- Fake pointed_thing
+						type = "node",
+						above = pos1,
+						under = { x=pos1.x, y=pos1.y-1, z=pos1.z },
+					})
+					if ok then
+						-- print("deploy_node: on_place succeeded!")
+						inv:set_stack(slot_name, 1, stk or stack1[1])
+						return
+					-- else
+						-- print("deploy_node: WARNING: error while running on_place: "..tostring(stk))
+					end
+				end
 				minetest.item_place_object(stack1[1], nil, {
 					-- Fake pointed_thing
 					type = "node",

--
Gitblit v1.8.0