Update `.mrkrthere` on death.

master
luk3yx 2018-12-30 17:23:49 +13:00
parent 32444fda73
commit 5d576cdbb1
2 changed files with 5 additions and 2 deletions

View File

@ -16,7 +16,8 @@ create HUDs on their own.
- `.mrkr_import`: Imports your markers from an advmarkers string (`.mrkr_import <advmarkers string>`). Any markers with the same name will not be overwritten, and if they do not have the same co-ordinates, `_` will be appended to the imported one.
- `.mrkrthere`: Sets a marker at the last `.coords` position.
If you die, a marker is automatically added at your death position.
If you die, a marker is automatically added at your death position, and will
update the last `.coords` position.
## Chat channels integration

View File

@ -245,7 +245,9 @@ end)
minetest.register_on_death(function()
if minetest.localplayer then
local name = os.date('Death on %Y-%m-%d %H:%M:%S')
advmarkers.set_marker(minetest.localplayer:get_pos(), name)
local pos = minetest.localplayer:get_pos()
advmarkers.last_coords = pos
advmarkers.set_marker(pos, name)
minetest.display_chat_message('Added marker "' .. name .. '".')
end
end)