code tidy, make protection field glow in dark

This commit is contained in:
TenPlus1 2019-05-20 16:46:22 +01:00
parent 8a5739486f
commit 08a07a76a9
2 changed files with 8 additions and 6 deletions

View File

@ -55,7 +55,7 @@ Change log:
- 2.5 - Added HUD text to show when player is inside a protected area (updates every 5 seconds)
- 2.6 - Add protection against CSM tampering, updated Intllib support (thanks codexp), tweaked block textures
- 2.7 - Remove protection field entity when protector has been dug
- 2.8 - Added 'protector_show_interval' setting to minetest.conf, default is 5
- 2.8 - Added 'protector_show_interval' setting to minetest.conf [default is 5], make protection field glow in dark.
Lucky Blocks: 10

View File

@ -5,10 +5,11 @@ local S = dofile(MP .. "/intllib.lua")
local F = minetest.formspec_escape
protector = {}
protector.mod = "redo"
protector.modpath = MP
protector.intllib = S
protector = {
mod = "redo",
modpath = MP,
intllib = S
}
local protector_max_share_count = 12
-- get minetest.conf settings
@ -620,12 +621,13 @@ minetest.register_entity("protector:display", {
visual_size = {x = 0.67, y = 0.67},
textures = {"protector:display_node"},
timer = 0,
glow = 10,
on_step = function(self, dtime)
self.timer = self.timer + dtime
-- remove after 5 seconds
-- remove after set number of seconds
if self.timer > protector_show then
self.object:remove()
end