mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-12-26 11:17:30 +01:00
Make fire aspect enchant respect attack reach limit
This commit is contained in:
parent
85b1f5247a
commit
b2507c3640
@ -133,10 +133,14 @@ minetest.register_on_punchplayer(function(player, hitter, time_from_last_punch,
|
|||||||
if wielditem then
|
if wielditem then
|
||||||
local fire_aspect_level = mcl_enchanting.get_enchantment(wielditem, "fire_aspect")
|
local fire_aspect_level = mcl_enchanting.get_enchantment(wielditem, "fire_aspect")
|
||||||
if fire_aspect_level > 0 then
|
if fire_aspect_level > 0 then
|
||||||
|
local player_pos = player:get_pos()
|
||||||
|
local hitter_pos = hitter:get_pos()
|
||||||
|
if vector.distance(hitter_pos, player_pos) <= 3 then
|
||||||
mcl_burning.set_on_fire(player, fire_aspect_level * 4)
|
mcl_burning.set_on_fire(player, fire_aspect_level * 4)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
mcl_enchanting.enchantments.flame = {
|
mcl_enchanting.enchantments.flame = {
|
||||||
|
Loading…
Reference in New Issue
Block a user