From cf04e717a00f19f8d7757624bb1ecf5da1e126e8 Mon Sep 17 00:00:00 2001 From: LoneWolfHT Date: Mon, 13 May 2024 17:34:18 -0700 Subject: [PATCH 1/3] playertag mod tweaks --- mods/other/playertag/init.lua | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/mods/other/playertag/init.lua b/mods/other/playertag/init.lua index e477a82af7..5f8aed89d6 100644 --- a/mods/other/playertag/init.lua +++ b/mods/other/playertag/init.lua @@ -15,12 +15,14 @@ local function add_entity_tag(player, old_observers) color = {a = 0, r = 0, g = 0, b = 0} }) - local ent = minetest.add_entity(player:get_pos(), "playertag:tag") + local ppos = player:get_pos() + + local ent = minetest.add_entity(ppos, "playertag:tag") local ent2 = false local ent3 = false if ent.set_observers then - ent2 = minetest.add_entity(player:get_pos(), "playertag:tag") + ent2 = minetest.add_entity(ppos, "playertag:tag") ent2:set_observers(old_observers.nametag_entity or {}) ent2:set_properties({ nametag = player:get_player_name(), @@ -28,7 +30,7 @@ local function add_entity_tag(player, old_observers) nametag_bgcolor = "#0000002D" }) - ent3 = minetest.add_entity(player:get_pos(), "playertag:tag") + ent3 = minetest.add_entity(ppos, "playertag:tag") ent3:set_observers(old_observers.symbol_entity or {}) ent3:set_properties({ collisionbox = { 0, 0, 0, 0, 0, 0 }, @@ -152,9 +154,17 @@ minetest.register_entity("playertag:tag", { physical = false, makes_footstep_sound = false, backface_culling = false, - static_save = false, + static_save = true, pointable = false, on_punch = function() return true end, + on_detach = function(self, parent) + self.object:remove() + end, + on_deactivate = function(self, removal) + if not removal then + self.object:remove() + end + end, }) minetest.register_on_joinplayer(function(player) From e635b4b588a91ce8c01dd401c4e53d3de85f2ef8 Mon Sep 17 00:00:00 2001 From: LoneWolfHT Date: Mon, 13 May 2024 17:37:39 -0700 Subject: [PATCH 2/3] Bugfix for teams that aren't playing --- mods/ctf/ctf_modebase/recent_rankings.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/mods/ctf/ctf_modebase/recent_rankings.lua b/mods/ctf/ctf_modebase/recent_rankings.lua index 98548d0ed6..42ea7fb07c 100644 --- a/mods/ctf/ctf_modebase/recent_rankings.lua +++ b/mods/ctf/ctf_modebase/recent_rankings.lua @@ -76,7 +76,17 @@ return { rankings_teams = {} end, players = function() return rankings_players end, - teams = function() return rankings_teams end, + teams = function() + local out = {} + + for k, v in pairs(rankings_teams) do + if not ctf_teams.team[k].not_playing then + out[k] = v + end + end + + return out + end, } end From 8a582a76d12535f4a54e14b7dbd67e9d3e808a2e Mon Sep 17 00:00:00 2001 From: LoneWolfHT Date: Mon, 13 May 2024 17:38:01 -0700 Subject: [PATCH 3/3] Fix issues with modes that have a set amount of rounds --- mods/ctf/ctf_modebase/mode_vote.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mods/ctf/ctf_modebase/mode_vote.lua b/mods/ctf/ctf_modebase/mode_vote.lua index 95c994394b..60c5dd0f93 100644 --- a/mods/ctf/ctf_modebase/mode_vote.lua +++ b/mods/ctf/ctf_modebase/mode_vote.lua @@ -129,9 +129,8 @@ function ctf_modebase.mode_vote.start_vote() timer = minetest.after(VOTING_TIME, ctf_modebase.mode_vote.end_vote) formspec_send_timer = minetest.after(2, send_formspec) else - ctf_modebase.current_mode_matches = mode_defined_rounds - ctf_modebase.mode_on_next_match = new_mode - ctf_modebase.start_match_after_vote() + votes = {mode_defined_rounds} + ctf_modebase.mode_vote.end_vote() end end