From 0ed4cadb7cc62447d76385b1db82c009675b2615 Mon Sep 17 00:00:00 2001 From: LoneWolfHT Date: Mon, 15 Mar 2021 08:25:14 -0700 Subject: [PATCH 1/3] Add missing priv check to /join cmd --- mods/ctf/ctf_chat/init.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/mods/ctf/ctf_chat/init.lua b/mods/ctf/ctf_chat/init.lua index d730c74..b00283f 100644 --- a/mods/ctf/ctf_chat/init.lua +++ b/mods/ctf/ctf_chat/init.lua @@ -183,6 +183,7 @@ minetest.register_chatcommand("team", { minetest.register_chatcommand("join", { params = "team name", description = "Add to team", + privs = {ctf_team_mgr = true}, func = function(name, param) if ctf.join(name, param, false, name) then return true, "Joined team " .. param .. "!" From 844436ca3d6f0320abdaf1c72643a6e9891ed9ff Mon Sep 17 00:00:00 2001 From: LoneWolfHT Date: Mon, 15 Mar 2021 08:30:54 -0700 Subject: [PATCH 2/3] Fix crash with shooter_hook --- mods/ctf/ctf_classes/ranged.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mods/ctf/ctf_classes/ranged.lua b/mods/ctf/ctf_classes/ranged.lua index 2abcffa..4939dda 100644 --- a/mods/ctf/ctf_classes/ranged.lua +++ b/mods/ctf/ctf_classes/ranged.lua @@ -73,6 +73,11 @@ check_grapple("shooter_hook:grapple_hook") -- Override grappling hook entity to check if player has flag before teleporting local old_grapple_step = minetest.registered_entities["shooter_hook:hook"].on_step minetest.registered_entities["shooter_hook:hook"].on_step = function(self, dtime, ...) + -- User left the game. Life is no longer worth living for this poor hook + if not self.user then + self.object:remove() + end + -- Remove entity if player has flag -- This is to prevent players from firing the hook, and then punching the flag if ctf_flag.has_flag(self.user) then From 1ef6ddadfd30be5f3671127c53c685a9ae4112d3 Mon Sep 17 00:00:00 2001 From: David Leal Date: Mon, 15 Mar 2021 21:08:01 -0600 Subject: [PATCH 3/3] Fix changing to the same class being treated as a change to a different class (#829) * Fix running cooldown when changing... ...to the same class. * Implement savilli's suggestion Co-authored-by: savilli * Move return and remove unneeded check * Completely remove an if check as now unneeded * Remove whitespace from empty line Co-authored-by: savilli Co-authored-by: LoneWolfHT --- mods/ctf/ctf_classes/api.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/mods/ctf/ctf_classes/api.lua b/mods/ctf/ctf_classes/api.lua index e474ddf..e8fe5f3 100644 --- a/mods/ctf/ctf_classes/api.lua +++ b/mods/ctf/ctf_classes/api.lua @@ -73,16 +73,18 @@ function ctf_classes.set(player, new_name) local meta = player:get_meta() local old_name = meta:get("ctf_classes:class") + if old_name == new_name then + return + end + meta:set_string("ctf_classes:class", new_name) ctf_classes.update(player) ctf_classes.set_cooldown(player:get_player_name()) - if old_name == nil or old_name ~= new_name then - local old = old_name and ctf_classes.__classes[old_name] - for i=1, #registered_on_changed do - registered_on_changed[i](player, old, new) - end + local old = old_name and ctf_classes.__classes[old_name] + for i=1, #registered_on_changed do + registered_on_changed[i](player, old, new) end end