mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-12-29 12:47:30 +01:00
fix API
This commit is contained in:
parent
30e50a64ef
commit
6a6b5970b3
@ -5,7 +5,7 @@ mcl_death_drop = {}
|
||||
mcl_death_drop.registered_dropped_lists = {}
|
||||
|
||||
function mcl_death_drop.register_dropped_list(inv, listname, drop)
|
||||
table.insert(mcl_death_drop.registered_dropped_player_lists, {inv=inv, listname=listname, drop=drop})
|
||||
table.insert(mcl_death_drop.registered_dropped_lists, {inv=inv, listname=listname, drop=drop})
|
||||
end
|
||||
|
||||
mcl_death_drop.register_dropped_list("PLAYER", "main", true)
|
||||
@ -17,7 +17,7 @@ minetest.register_on_dieplayer(function(player)
|
||||
local keep = minetest.settings:get_bool("mcl_keepInventory", false)
|
||||
if keep == false then
|
||||
-- Drop inventory, crafting grid and armor
|
||||
local inv = player:get_inventory()
|
||||
local playerinv = player:get_inventory()
|
||||
local pos = player:get_pos()
|
||||
local name, player_armor_inv, armor_armor_inv, pos = armor:get_valid_player(player, "[on_dieplayer]")
|
||||
-- No item drop if in deep void
|
||||
@ -25,6 +25,11 @@ minetest.register_on_dieplayer(function(player)
|
||||
|
||||
for l=1,#mcl_death_drop.registered_dropped_lists do
|
||||
local inv = mcl_death_drop.registered_dropped_lists[l].inv
|
||||
if inv == "PLAYER" then
|
||||
inv = playerinv
|
||||
elseif type(inv) == "function" then
|
||||
inv = inv(player)
|
||||
end
|
||||
local listname = mcl_death_drop.registered_dropped_lists[l].listname
|
||||
local drop = mcl_death_drop.registered_dropped_lists[l].drop
|
||||
if inv ~= nil then
|
||||
|
Loading…
Reference in New Issue
Block a user