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 <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: teknomunk <teknomunk@protonmail.com>
Co-committed-by: teknomunk <teknomunk@protonmail.com>
This commit is contained in:
teknomunk 2024-05-30 08:02:59 +00:00 committed by the-real-herowl
parent 6394371e4f
commit c4f4e7b6fc
2 changed files with 4 additions and 4 deletions

@ -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_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}) obj:set_acceleration({x=dropdir.x*-3, y=-9.8, z=dropdir.z*-3})
local ent = obj:get_luaentity() local ent = obj:get_luaentity()
ent._potency = item:get_meta():get_int("mcl_potions:potion_potent") ent._potency = stack:get_meta():get_int("mcl_potions:potion_potent")
ent._plus = item:get_meta():get_int("mcl_potions:potion_plus") ent._plus = stack:get_meta():get_int("mcl_potions:potion_plus")
ent._effect_list = def._effect_list ent._effect_list = def._effect_list
end end
}) })

@ -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_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}) obj:set_acceleration({x=dropdir.x*-3, y=-9.8, z=dropdir.z*-3})
local ent = obj:get_luaentity() local ent = obj:get_luaentity()
ent._potency = item:get_meta():get_int("mcl_potions:potion_potent") ent._potency = stack:get_meta():get_int("mcl_potions:potion_potent")
ent._plus = item:get_meta():get_int("mcl_potions:potion_plus") ent._plus = stack:get_meta():get_int("mcl_potions:potion_plus")
ent._effect_list = def._effect_list ent._effect_list = def._effect_list
end end
}) })