From c4f4e7b6fc4d296bf9a17136cdfc1eac624bf1b1 Mon Sep 17 00:00:00 2001 From: teknomunk Date: Thu, 30 May 2024 08:02:59 +0000 Subject: [PATCH] Fix crash that occurs when lingering or splash potions are used from a dispenser (#4335) Reviewed-on: https://git.minetest.land/VoxeLibre/VoxeLibre/pulls/4335 Reviewed-by: the-real-herowl Co-authored-by: teknomunk Co-committed-by: teknomunk --- mods/ITEMS/mcl_potions/lingering.lua | 4 ++-- mods/ITEMS/mcl_potions/splash.lua | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mods/ITEMS/mcl_potions/lingering.lua b/mods/ITEMS/mcl_potions/lingering.lua index 0eeb40b50..20ed84850 100644 --- a/mods/ITEMS/mcl_potions/lingering.lua +++ b/mods/ITEMS/mcl_potions/lingering.lua @@ -173,8 +173,8 @@ function mcl_potions.register_lingering(name, descr, color, def) obj:set_velocity({x=dropdir.x*velocity,y=dropdir.y*velocity,z=dropdir.z*velocity}) obj:set_acceleration({x=dropdir.x*-3, y=-9.8, z=dropdir.z*-3}) local ent = obj:get_luaentity() - ent._potency = item:get_meta():get_int("mcl_potions:potion_potent") - ent._plus = item:get_meta():get_int("mcl_potions:potion_plus") + ent._potency = stack:get_meta():get_int("mcl_potions:potion_potent") + ent._plus = stack:get_meta():get_int("mcl_potions:potion_plus") ent._effect_list = def._effect_list end }) diff --git a/mods/ITEMS/mcl_potions/splash.lua b/mods/ITEMS/mcl_potions/splash.lua index 3b9261458..591bb30e4 100644 --- a/mods/ITEMS/mcl_potions/splash.lua +++ b/mods/ITEMS/mcl_potions/splash.lua @@ -65,8 +65,8 @@ function mcl_potions.register_splash(name, descr, color, def) obj:set_velocity({x=dropdir.x*velocity,y=dropdir.y*velocity,z=dropdir.z*velocity}) obj:set_acceleration({x=dropdir.x*-3, y=-9.8, z=dropdir.z*-3}) local ent = obj:get_luaentity() - ent._potency = item:get_meta():get_int("mcl_potions:potion_potent") - ent._plus = item:get_meta():get_int("mcl_potions:potion_plus") + ent._potency = stack:get_meta():get_int("mcl_potions:potion_potent") + ent._plus = stack:get_meta():get_int("mcl_potions:potion_plus") ent._effect_list = def._effect_list end })