From 77d834ac5ed442a66472789315ee63956a2e8827 Mon Sep 17 00:00:00 2001 From: cora Date: Fri, 15 Jul 2022 17:09:04 +0200 Subject: [PATCH] Add PVP check to tipped arrows --- mods/ITEMS/mcl_potions/tipped_arrow.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_potions/tipped_arrow.lua b/mods/ITEMS/mcl_potions/tipped_arrow.lua index a3dbe84c28..3c18fe7250 100644 --- a/mods/ITEMS/mcl_potions/tipped_arrow.lua +++ b/mods/ITEMS/mcl_potions/tipped_arrow.lua @@ -30,6 +30,7 @@ local how_to_shoot = minetest.registered_items["mcl_bows:arrow"]._doc_items_usag local mod_awards = minetest.get_modpath("awards") and minetest.get_modpath("mcl_achievements") local mod_button = minetest.get_modpath("mesecons_button") +local enable_pvp = minetest.settings:get_bool("enable_pvp") local arrow_longdesc = minetest.registered_items["mcl_bows:arrow"]._doc_items_longdesc or "" local arrow_tt = minetest.registered_items["mcl_bows:arrow"]._tt_help or "" @@ -217,7 +218,7 @@ function mcl_potions.register_arrow(name, desc, color, def) if hitpoint.type == "object" then -- find the closest object that is in the way of the arrow local ok = false - if hitpoint.ref:is_player() then + if hitpoint.ref:is_player() and enable_pvp then ok = true elseif hitpoint.ref:get_luaentity() then if (hitpoint.ref:get_luaentity().is_mob or hitpoint.ref:get_luaentity()._hittable_by_projectile) then