diff --git a/mods/kingdoms/chat.lua b/mods/kingdoms/chat.lua index abff70e..eabe263 100644 --- a/mods/kingdoms/chat.lua +++ b/mods/kingdoms/chat.lua @@ -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" diff --git a/mods/kingdoms/markers.lua b/mods/kingdoms/markers.lua index eed794c..552e6c9 100644 --- a/mods/kingdoms/markers.lua +++ b/mods/kingdoms/markers.lua @@ -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