rolling-3
parent
b26d52e404
commit
5298d0df20
|
@ -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":{
|
||||
|
|
16
main.lua
16
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
|
||||
|
|
Loading…
Reference in New Issue