From 47d9473e2ec0001292ea0509c8df4f65cafdd1ee Mon Sep 17 00:00:00 2001 From: LoneWolfHT Date: Sat, 12 Dec 2020 15:32:52 -0800 Subject: [PATCH] Change knight sword ability trigger to Sneak+RMB --- mods/ctf/ctf_classes/melee.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mods/ctf/ctf_classes/melee.lua b/mods/ctf/ctf_classes/melee.lua index a313e27..6177263 100644 --- a/mods/ctf/ctf_classes/melee.lua +++ b/mods/ctf/ctf_classes/melee.lua @@ -41,7 +41,7 @@ local function sword_special_timer_func(pname, timeleft) end minetest.register_tool("ctf_classes:sword_steel", { - description = "Knight's Sword\nRightclick enemies/items/air to place marker\nMark enemies to show all enemies in area", + description = "Knight's Sword\nSneak+Rightclick items/air to place marker\nRightclick enemies to place marker listing all enemies in area", inventory_image = "default_tool_steelsword.png", tool_capabilities = { full_punch_interval = 0.8, @@ -95,6 +95,9 @@ minetest.register_tool("ctf_classes:sword_steel", { return end + -- Check if player is sneaking before placing marker + if not placer:get_player_control().sneak then return end + if pointed_thing.type == "node" then return minetest.item_place(itemstack, placer, pointed_thing) end