From c7e43e31d4e6c1a161b57f64338fc1b6db5ddccb Mon Sep 17 00:00:00 2001 From: teknomunk Date: Tue, 28 May 2024 19:05:00 -0500 Subject: [PATCH] Convert crash to a warning --- mods/ITEMS/mcl_potions/functions.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mods/ITEMS/mcl_potions/functions.lua b/mods/ITEMS/mcl_potions/functions.lua index 90ac35004..fc03b9012 100644 --- a/mods/ITEMS/mcl_potions/functions.lua +++ b/mods/ITEMS/mcl_potions/functions.lua @@ -1832,6 +1832,10 @@ end function mcl_potions.give_effect_by_level(name, object, level, duration, no_particles) if level == 0 then return false end + if not registered_effects[name] then + minetest.log("warning", "[mcl_potions] Trying to give unknown effect "..name) + return false + end if not registered_effects[name].uses_factor then return mcl_potions.give_effect(name, object, 0, duration, no_particles) end