Skip to content

Commit

Permalink
to make bones_mode = keep work
Browse files Browse the repository at this point in the history
  • Loading branch information
imre84 committed Mar 31, 2024
1 parent 5cc2b46 commit c2cfa87
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions mods/bones/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -308,10 +308,6 @@ end)


local function collect_items(player, player_name)
if minetest.is_creative_enabled(player_name) then
return {}
end

local items = {}
for _, cb in ipairs(collect_items_callbacks) do
table.insert_all(items, cb(player))
Expand Down Expand Up @@ -386,9 +382,15 @@ minetest.register_on_dieplayer(function(player)
local bones_position_message = minetest.settings:get_bool("bones_position_message") == true
local pos_string = minetest.pos_to_string(player:get_pos())

local items = collect_items(player, player_name)
local items = {}

if not minetest.is_creative_enabled(player_name) and
bones_mode ~= "keep"
then
items = collect_items(player, player_name)
end

if bones_mode == "keep" or #items == 0 then
if #items == 0 then
minetest.log("action", player_name .. " dies at " .. pos_string ..
". No bones placed")
if bones_position_message then
Expand Down

0 comments on commit c2cfa87

Please sign in to comment.