From 5d576cdbb1ceb7f12cc28862acaf81177d7ef1aa Mon Sep 17 00:00:00 2001 From: luk3yx Date: Sun, 30 Dec 2018 17:23:49 +1300 Subject: [PATCH] Update `.mrkrthere` on death. --- README.md | 3 ++- init.lua | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8eae77b..efd20ed 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,8 @@ create HUDs on their own. - `.mrkr_import`: Imports your markers from an advmarkers string (`.mrkr_import `). 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 diff --git a/init.lua b/init.lua index 689f62b..e07c214 100644 --- a/init.lua +++ b/init.lua @@ -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)