diff --git a/mods/ITEMS/mcl_potions/functions.lua b/mods/ITEMS/mcl_potions/functions.lua index 69692fab..777f090a 100644 --- a/mods/ITEMS/mcl_potions/functions.lua +++ b/mods/ITEMS/mcl_potions/functions.lua @@ -352,7 +352,7 @@ function mcl_potions.is_obj_hit(self, pos) if entity._cmi_is_mob then return true end - elseif object:is_player() then + elseif object:is_player() and self._thrower ~= object:get_player_name() then return true end diff --git a/mods/ITEMS/mcl_potions/lingering.lua b/mods/ITEMS/mcl_potions/lingering.lua index 57436499..15e0f732 100644 --- a/mods/ITEMS/mcl_potions/lingering.lua +++ b/mods/ITEMS/mcl_potions/lingering.lua @@ -78,9 +78,10 @@ function mcl_potions.register_lingering(name, descr, color, def) local velocity = 10 local dir = placer:get_look_dir(); local pos = placer:getpos(); - local obj = minetest.add_entity({x=pos.x+(dir.x*2),y=pos.y+2+(dir.y*3),z=pos.z+(dir.z*2)}, id.."_flying") + local obj = minetest.add_entity({x=pos.x+dir.x,y=pos.y+2+dir.y,z=pos.z+dir.z}, id.."_flying") obj:setvelocity({x=dir.x*velocity,y=dir.y*velocity,z=dir.z*velocity}) obj:setacceleration({x=dir.x*-3, y=-9.8, z=dir.z*-3}) + obj:get_luaentity()._thrower = placer:get_player_name() if not minetest.is_creative_enabled(placer:get_player_name()) then item:take_item() end diff --git a/mods/ITEMS/mcl_potions/splash.lua b/mods/ITEMS/mcl_potions/splash.lua index 9b8d004f..8fa20510 100644 --- a/mods/ITEMS/mcl_potions/splash.lua +++ b/mods/ITEMS/mcl_potions/splash.lua @@ -20,9 +20,10 @@ function mcl_potions.register_splash(name, descr, color, def) local velocity = 10 local dir = placer:get_look_dir(); local pos = placer:get_pos(); - local obj = minetest.add_entity({x=pos.x+(dir.x*2),y=pos.y+2+(dir.y*3),z=pos.z+(dir.z*2)}, id.."_flying") + local obj = minetest.add_entity({x=pos.x+dir.x,y=pos.y+2+dir.y,z=pos.z+dir.z}, id.."_flying") obj:set_velocity({x=dir.x*velocity,y=dir.y*velocity,z=dir.z*velocity}) obj:set_acceleration({x=dir.x*-3, y=-9.8, z=dir.z*-3}) + obj:get_luaentity()._thrower = placer:get_player_name() if not minetest.is_creative_enabled(placer:get_player_name()) then item:take_item() end