Trade: Added basic logic for dedicated traders offers.

This commit is contained in:
zorman2000
2017-01-30 21:51:16 -05:00
parent 54c005ec34
commit b3b9bf393f
2 changed files with 50 additions and 1 deletions

10
npc.lua
View File

@ -524,7 +524,17 @@ local function npc_spawn(self, pos)
--npc.add_action(ent, npc.actions.set_interval, {self=ent, interval=10, freeze=true})
npc.add_action(ent, npc.actions.freeze, {freeze = false})
end
-- Dedicated trade test
ent.trader_data.trade_list = {
"default:tree",
"default:cobble",
"default:wood"
}
local trade_offers = npc.trade.get_trade_offers_for_dedicated_trader(ent)
minetest.log("Trade offers: "..dump(trade_offers))
-- npc.add_action(ent, npc.action.stand, {self = ent})
-- npc.add_action(ent, npc.action.stand, {self = ent})
-- npc.add_action(ent, npc.action.walk_step, {self = ent, dir = npc.direction.east})