From bf23c61e34b36fcd0a9c788d5088c882f6b66edc Mon Sep 17 00:00:00 2001 From: cora Date: Sat, 16 Jul 2022 00:43:18 +0200 Subject: [PATCH] skip damage completely when player & pvp disabled --- mods/ITEMS/mcl_bows/arrow.lua | 2 +- mods/ITEMS/mcl_bows/rocket.lua | 2 +- mods/ITEMS/mcl_potions/tipped_arrow.lua | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mods/ITEMS/mcl_bows/arrow.lua b/mods/ITEMS/mcl_bows/arrow.lua index a2ba96f364..a03b875cbe 100644 --- a/mods/ITEMS/mcl_bows/arrow.lua +++ b/mods/ITEMS/mcl_bows/arrow.lua @@ -207,7 +207,7 @@ function ARROW_ENTITY.on_step(self, dtime) local ok = false if hitpoint.ref:is_player() and enable_pvp then ok = true - elseif hitpoint.ref:get_luaentity() then + elseif not hitpoint.ref:is_player() and hitpoint.ref:get_luaentity() then if (hitpoint.ref:get_luaentity().is_mob or hitpoint.ref:get_luaentity()._hittable_by_projectile) then ok = true end diff --git a/mods/ITEMS/mcl_bows/rocket.lua b/mods/ITEMS/mcl_bows/rocket.lua index 3d311eeb20..d25c526473 100644 --- a/mods/ITEMS/mcl_bows/rocket.lua +++ b/mods/ITEMS/mcl_bows/rocket.lua @@ -420,7 +420,7 @@ function ARROW_ENTITY.on_step(self, dtime) local ok = false if hitpoint.ref:is_player() and enable_pvp then ok = true - elseif hitpoint.ref:get_luaentity() then + elseif not hitpoint.ref:is_player() and hitpoint.ref:get_luaentity() then if (hitpoint.ref:get_luaentity().is_mob or hitpoint.ref:get_luaentity()._hittable_by_projectile) then ok = true end diff --git a/mods/ITEMS/mcl_potions/tipped_arrow.lua b/mods/ITEMS/mcl_potions/tipped_arrow.lua index 3c18fe7250..f42718a12d 100644 --- a/mods/ITEMS/mcl_potions/tipped_arrow.lua +++ b/mods/ITEMS/mcl_potions/tipped_arrow.lua @@ -220,7 +220,7 @@ function mcl_potions.register_arrow(name, desc, color, def) local ok = false if hitpoint.ref:is_player() and enable_pvp then ok = true - elseif hitpoint.ref:get_luaentity() then + elseif not hitpoint.ref:is_player() and hitpoint.ref:get_luaentity() then if (hitpoint.ref:get_luaentity().is_mob or hitpoint.ref:get_luaentity()._hittable_by_projectile) then ok = true end