From 6ee151759b6f5cdcd9a44f452f7b66b6dffbbe06 Mon Sep 17 00:00:00 2001 From: Bram van den Heuvel Date: Wed, 21 Feb 2024 00:32:46 +0100 Subject: [PATCH] Remove nil value on death message --- init.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 90aac0f..af1113b 100644 --- a/init.lua +++ b/init.lua @@ -41,9 +41,10 @@ minetest.register_on_leaveplayer(function(ObjectRef, timed_out) end) minetest.register_on_dieplayer(function(ObjectRef, reason) local name = ObjectRef:get_player_name() - matrix.send(http_api, name .. " has died! Reason:", reason) - if reason.type == "fall" then + if reason.type == nil then + matrix.send(http_api, name .. " died. Reason:", "unknown") + elseif reason.type == "fall" then matrix.send(http_api, name .. " fell from a high place") elseif reason.type == "drown" then matrix.send(http_api, name .. " drowned")