From 5298d0df2084033da4811fede660da7f3deeb767 Mon Sep 17 00:00:00 2001 From: Lars Mueller Date: Sat, 29 Feb 2020 13:06:58 +0100 Subject: [PATCH] rolling-3 --- default_config.json | 2 +- main.lua | 16 +++++----------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/default_config.json b/default_config.json index 5af7001..e4c05b8 100644 --- a/default_config.json +++ b/default_config.json @@ -5,7 +5,7 @@ "hud_pos":{"x":0.75,"y":1}, "hud_base_offset": {"x":0,"y":-122}, "enable_environmental": true, - "enable_unknown": false, + "enable_unknown": true, "enable_forbidden_playernames": true, "environmental_reasons": { "falling":{ diff --git a/main.lua b/main.lua index 70156d9..ed45095 100644 --- a/main.lua +++ b/main.lua @@ -1,9 +1,3 @@ ---- ---- Generated by EmmyLua(https://github.com/EmmyLua) ---- Created by lars. ---- DateTime: 11.03.19 18:28 ---- - modlib.log.create_channel("deathlist") -- Create modlib.log channel local coordinate={type="table", @@ -29,10 +23,10 @@ local config=modlib.conf.import("deathlist",{ mode={type="string", possible_values={list=true,stack=true}}, autoremove_interval={func=function(interval) if type(interval) ~= "number" and interval ~= false then - return "Wrong type : Expected number or false, found "..type(interval) + return "Wrong type: Expected number or false, found "..type(interval) end if interval <= 0 then - return "Too small : Interval has to be > 0" + return "Too small: Interval has to be > 0" end end}, hud_pos=coordinate, @@ -98,7 +92,7 @@ modlib.table.map(environmental_reasons.node_damage.nodes, function(v) return v end) -hud_channels ={ killers={}, items={}, victims={}} -- in order to reduce overhead +hud_channels = {killers={}, items={}, victims={}} -- in order to reduce overhead minetest.register_on_joinplayer(function(player) hud_channels.killers[player:get_player_name()]={} @@ -126,7 +120,7 @@ function remove_last_kill_msg_from_hud(listname, x_offset) for j=2,i do local new={x=hud_base_offset.x+x_offset,y=hud_base_offset.y-((j-2)*20)} player:hud_change(hud_ids[j],"offset",new) - hud_ids[j-1]=hud_ids[j] --Perform index shift + hud_ids[j-1]=hud_ids[j] -- Perform index shift end hud_ids[i]=nil end @@ -240,7 +234,7 @@ if enable_environmental then end add_node_kill_message(killing_node, "node_damage", victim) modlib.log.write("deathlist","Player "..victim.name.." died due to node damage of "..killing_node.name) - elseif reason.type~="punch" and enable_unknown then + elseif reason.type ~= "punch" and enable_unknown then add_environmental_kill_message("unknown", victim) modlib.log.write("deathlist","Player "..victim.name.." died for unknown reasons.") end