forked from MineClone5/MineClone5
Fix crash in mcl_bows/rocket.lua:41
This commit is contained in:
parent
a637e4bdaf
commit
89cbc1deed
|
@ -38,11 +38,14 @@ local function damage_explosion(self, damagemulitplier)
|
||||||
for _,obj in pairs(objects) do
|
for _,obj in pairs(objects) do
|
||||||
if obj:is_player() then
|
if obj:is_player() then
|
||||||
mcl_util.deal_damage(obj, damagemulitplier - vector.distance(self.object:get_pos(), obj:get_pos()), {type = "explosion"})
|
mcl_util.deal_damage(obj, damagemulitplier - vector.distance(self.object:get_pos(), obj:get_pos()), {type = "explosion"})
|
||||||
elseif obj:get_luaentity()._cmi_is_mob then
|
else
|
||||||
obj:punch(self.object, 1.0, {
|
local entity = obj:get_luaentity()
|
||||||
full_punch_interval=1.0,
|
if entity and entity._cmi_is_mob then
|
||||||
damage_groups={fleshy=damagemulitplier - vector.distance(self.object:get_pos(), obj:get_pos())},
|
obj:punch(self.object, 1.0, {
|
||||||
}, self.object:get_velocity())
|
full_punch_interval=1.0,
|
||||||
|
damage_groups={fleshy=damagemulitplier - vector.distance(self.object:get_pos(), obj:get_pos())},
|
||||||
|
}, self.object:get_velocity())
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue