mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-12-27 03:37:31 +01:00
Fix drinking a potion never depleting it
This commit is contained in:
parent
12ca804488
commit
cef20edd53
@ -62,9 +62,13 @@ function return_on_use(def, effect, dur)
|
|||||||
end
|
end
|
||||||
|
|
||||||
def.on_use(user, effect, dur)
|
def.on_use(user, effect, dur)
|
||||||
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
local old_name, old_count = itemstack:get_name(), itemstack:get_count()
|
||||||
|
itemstack = minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
||||||
|
if old_name ~= itemstack:get_name() or old_count ~= itemstack:get_count() then
|
||||||
mcl_potions._use_potion(itemstack, user, def.color)
|
mcl_potions._use_potion(itemstack, user, def.color)
|
||||||
end
|
end
|
||||||
|
return itemstack
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user