From 163ca9a653ae724c67649f384baffc649d0b5c7e Mon Sep 17 00:00:00 2001 From: kay27 Date: Fri, 25 Jun 2021 03:57:01 +0400 Subject: [PATCH] [fire_charge] Fix critical attempt to index local 'ent' --- mods/ITEMS/mcl_fire/fire_charge.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/mods/ITEMS/mcl_fire/fire_charge.lua b/mods/ITEMS/mcl_fire/fire_charge.lua index 4d18e44edc..5c33288f7b 100644 --- a/mods/ITEMS/mcl_fire/fire_charge.lua +++ b/mods/ITEMS/mcl_fire/fire_charge.lua @@ -49,11 +49,13 @@ minetest.register_craftitem("mcl_fire:fire_charge", { local shootpos = vector.add(pos, vector.multiply(dropdir, 0.51)) local fireball = add_entity(shootpos, "mobs_mc:blaze_fireball") local ent = fireball:get_luaentity() - ent._shot_from_dispenser = true - local v = ent.velocity or 1 - fireball:set_velocity(vector.multiply(dropdir, v)) - ent.switch = 1 - stack:take_item() + if ent then + ent._shot_from_dispenser = true + local v = ent.velocity or 1 + fireball:set_velocity(vector.multiply(dropdir, v)) + ent.switch = 1 + stack:take_item() + end end, })