[fire_charge] Fix critical attempt to index local 'ent'

This commit is contained in:
kay27 2021-06-25 03:57:01 +04:00
parent 35f07a8b66
commit 163ca9a653
1 changed files with 7 additions and 5 deletions

View File

@ -49,11 +49,13 @@ minetest.register_craftitem("mcl_fire:fire_charge", {
local shootpos = vector.add(pos, vector.multiply(dropdir, 0.51)) local shootpos = vector.add(pos, vector.multiply(dropdir, 0.51))
local fireball = add_entity(shootpos, "mobs_mc:blaze_fireball") local fireball = add_entity(shootpos, "mobs_mc:blaze_fireball")
local ent = fireball:get_luaentity() local ent = fireball:get_luaentity()
ent._shot_from_dispenser = true if ent then
local v = ent.velocity or 1 ent._shot_from_dispenser = true
fireball:set_velocity(vector.multiply(dropdir, v)) local v = ent.velocity or 1
ent.switch = 1 fireball:set_velocity(vector.multiply(dropdir, v))
stack:take_item() ent.switch = 1
stack:take_item()
end
end, end,
}) })