Fixed bug, added marker count to kingdom info

This commit is contained in:
Billy S 2019-04-27 01:26:39 -04:00
parent cf7cceb51b
commit 1b44d6f7d5
2 changed files with 11 additions and 0 deletions

View File

@ -86,6 +86,12 @@ ChatCmdBuilder.new("kingdoms", function(cmd)
-- Get members
local numMembers = kingdoms.helpers.count_table(k.members)
info = info .. tostring(numMembers) .. " Members: " .. kingdoms.helpers.keys_to_str(k.members) .. "\n"
-- Get markers
local numMarkers = 0
for _,m in pairs(kingdoms.markers) do
if m.kingdom == kingdom then numMarkers = numMarkers + 1 end
end
info = info .. tostring(numMarkers) .. " Markers\n"
-- Get ranks
local numRanks = kingdoms.helpers.count_table(k.ranks)
info = info .. tostring(numRanks) .. " Ranks: " .. kingdoms.helpers.keys_to_str(k.ranks) .. "\n"

View File

@ -216,6 +216,11 @@ for c,v in pairs(kingdoms.colors) do
meta:set_string("infotext", get_infotext(dkingdom, akingdom, (1 - (cd / kingdoms.marker_capture_time)) * 100))
meta:set_float("countdown", cd)
return true
end,
after_dig_node = function(pos)
local hpos = minetest.hash_node_position(pos)
kingdoms.markers[hpos] = nil
kingdoms.helpers.save()
end
})
end