From 6a9a00b3876ce21a0935064cedb885be57b97ad6 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Tue, 12 Dec 2017 23:53:54 +0100 Subject: [PATCH] Add death message if player killed by lightning --- mods/ENVIRONMENT/lightning/depends.txt | 1 + mods/ENVIRONMENT/lightning/init.lua | 3 +++ 2 files changed, 4 insertions(+) diff --git a/mods/ENVIRONMENT/lightning/depends.txt b/mods/ENVIRONMENT/lightning/depends.txt index 47738767fb..356c2f185a 100644 --- a/mods/ENVIRONMENT/lightning/depends.txt +++ b/mods/ENVIRONMENT/lightning/depends.txt @@ -1 +1,2 @@ mcl_fire +mcl_death_messages? diff --git a/mods/ENVIRONMENT/lightning/init.lua b/mods/ENVIRONMENT/lightning/init.lua index d1e751957f..0f3061e43c 100644 --- a/mods/ENVIRONMENT/lightning/init.lua +++ b/mods/ENVIRONMENT/lightning/init.lua @@ -177,6 +177,9 @@ lightning.strike = function(pos) local lua = obj:get_luaentity() if obj:is_player() then -- Player damage + if minetest.get_modpath("mcl_death_messages") then + mcl_death_messages.player_damage(obj, string.format("%s was struck by lightning.", obj:get_player_name())) + end obj:set_hp(obj:get_hp()-5) -- Mobs elseif lua and lua._cmi_is_mob then