From 4a713b4f70e936af90343a5beb9dd0217aa1601a Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Sun, 22 Nov 2015 19:21:19 +0000 Subject: [PATCH] Add items on respawn --- mods/give_initial_stuff/init.lua | 10 +++++++--- mods/shooter/depends.txt | 3 --- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/mods/give_initial_stuff/init.lua b/mods/give_initial_stuff/init.lua index 187fe5a..304b3db 100644 --- a/mods/give_initial_stuff/init.lua +++ b/mods/give_initial_stuff/init.lua @@ -1,10 +1,14 @@ function give_initial_stuff(player) if minetest.setting_getbool("give_initial_stuff") then minetest.log("action", "Giving initial stuff to player "..player:get_player_name()) - player:get_inventory():add_item('main', 'default:pick_wood') - player:get_inventory():add_item('main', 'default:sword_wood') - player:get_inventory():add_item('main', 'default:torch 3') + local inv = player:get_inventory() + inv:set_list("main", {}) + inv:set_list("craft", {}) + inv:add_item('main', 'default:pick_wood') + inv:add_item('main', 'default:sword_wood') + inv:add_item('main', 'default:torch 3') end end minetest.register_on_newplayer(give_initial_stuff) +minetest.register_on_respawnplayer(give_initial_stuff) diff --git a/mods/shooter/depends.txt b/mods/shooter/depends.txt index d2aa8ff..4c20936 100644 --- a/mods/shooter/depends.txt +++ b/mods/shooter/depends.txt @@ -1,5 +1,2 @@ default -dye -tnt -wool mobs?