Skip to content

Commit

Permalink
index waypoint with death-count
Browse files Browse the repository at this point in the history
makes it easy to distinguish bones from each other in case of multiple deaths during visible time.
  • Loading branch information
SwissalpS committed Nov 1, 2019
1 parent 5a9dce3 commit 25b7860
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion death.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,17 @@ minetest.register_on_dieplayer(function(player)
minetest.log("action", "[death] player '" .. player_name .. "' died at " .. pos_string)
minetest.chat_send_player(player_name, "You died at " .. pos_string)

local bone_string = "Bones"
if player.get_attribute then
-- [xp_redo] keeps track of deathcount, let's see if it is there
local count = player:get_attribute("died")
if count then
bone_string = "Bone #" .. tostring(count)
end
end -- if not fake player
local hud_id = player:hud_add({
hud_elem_type = "waypoint",
name = "Bones " .. pos_string,
name = bone_string .. " " .. pos_string,
text = "m",
number = 0xFFFFFF,
world_pos = pos
Expand Down

0 comments on commit 25b7860

Please sign in to comment.