From b7f8a75d0417413c8a96d18063f153d633f47fac Mon Sep 17 00:00:00 2001 From: cora Date: Fri, 15 Jul 2022 17:07:51 +0200 Subject: [PATCH] Add PVP check for rocket arrows --- mods/ITEMS/mcl_bows/rocket.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_bows/rocket.lua b/mods/ITEMS/mcl_bows/rocket.lua index c47989e3e9..3d311eeb20 100644 --- a/mods/ITEMS/mcl_bows/rocket.lua +++ b/mods/ITEMS/mcl_bows/rocket.lua @@ -231,6 +231,7 @@ end local mod_awards = minetest.get_modpath("awards") and minetest.get_modpath("mcl_achievements") local mod_button = minetest.get_modpath("mesecons_button") local mod_target = minetest.get_modpath("mcl_target") +local enable_pvp = minetest.settings:get_bool("enable_pvp") minetest.register_craftitem("mcl_bows:rocket", { description = S("Arrow"), @@ -417,7 +418,7 @@ function ARROW_ENTITY.on_step(self, dtime) 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