Make on_lightning_strike available to non-mob entities
This commit is contained in:
parent
2c4a768685
commit
fcba67b7e7
|
@ -135,7 +135,7 @@ function lightning.strike_func(pos, pos2, objects)
|
||||||
-- damage nearby objects, transform mobs
|
-- damage nearby objects, transform mobs
|
||||||
for _, obj in pairs(objects) do
|
for _, obj in pairs(objects) do
|
||||||
local lua = obj:get_luaentity()
|
local lua = obj:get_luaentity()
|
||||||
if lua and lua.is_mob then
|
if lua then
|
||||||
if not lua.on_lightning_strike or ( lua.on_lightning_strike and lua.on_lightning_strike(lua, pos, pos2, objects) ) ~= true then
|
if not lua.on_lightning_strike or ( lua.on_lightning_strike and lua.on_lightning_strike(lua, pos, pos2, objects) ) ~= true then
|
||||||
mcl_util.deal_damage(obj, 5, { type = "lightning_bolt" })
|
mcl_util.deal_damage(obj, 5, { type = "lightning_bolt" })
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user