mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-12-11 12:13:15 +01:00
Fix throwables' punch allow check
This commit is contained in:
parent
d8e875b73a
commit
b25d2ef31d
@ -54,6 +54,9 @@ vl_projectile.register("mcl_throwing:egg_entity",{
|
|||||||
if self._owner == object:get_player_name() then
|
if self._owner == object:get_player_name() then
|
||||||
return self.timer > 1
|
return self.timer > 1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local le = object:get_luaentity()
|
||||||
|
return le and le.is_mob or le._hittable_by_projectile or object:is_player()
|
||||||
end,
|
end,
|
||||||
on_collide_with_solid = function(self, pos, node)
|
on_collide_with_solid = function(self, pos, node)
|
||||||
if mod_target and node.name == "mcl_target:target_off" then
|
if mod_target and node.name == "mcl_target:target_off" then
|
||||||
|
@ -128,6 +128,9 @@ vl_projectile.register("mcl_throwing:ender_pearl_entity",{
|
|||||||
if self._owner == object:get_player_name() then
|
if self._owner == object:get_player_name() then
|
||||||
return self.timer > 1
|
return self.timer > 1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local le = object:get_luaentity()
|
||||||
|
return le and le.is_mob or le._hittable_by_projectile or object:is_player()
|
||||||
end,
|
end,
|
||||||
on_collide_with_entity = function(self, pos, entity)
|
on_collide_with_entity = function(self, pos, entity)
|
||||||
on_collide(self, pos, minetest.get_node(pos))
|
on_collide(self, pos, minetest.get_node(pos))
|
||||||
|
@ -59,7 +59,8 @@ vl_projectile.register("mcl_throwing:snowball_entity", {
|
|||||||
return self.timer > 1
|
return self.timer > 1
|
||||||
end
|
end
|
||||||
|
|
||||||
return object.is_mob or object._hittable_by_projectile or object:is_player()
|
local le = object:get_luaentity()
|
||||||
|
return le and le.is_mob or le._hittable_by_projectile or object:is_player()
|
||||||
end,
|
end,
|
||||||
on_collide_with_solid = function(self, pos, node)
|
on_collide_with_solid = function(self, pos, node)
|
||||||
if mod_target and node.name == "mcl_target:target_off" then
|
if mod_target and node.name == "mcl_target:target_off" then
|
||||||
|
Loading…
Reference in New Issue
Block a user