mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-04 23:31:05 +01:00
Fix drinking a potion never depleting it
This commit is contained in:
parent
12ca804488
commit
cef20edd53
1 changed files with 6 additions and 2 deletions
|
@ -62,8 +62,12 @@ function return_on_use(def, effect, dur)
|
|||
end
|
||||
|
||||
def.on_use(user, effect, dur)
|
||||
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
||||
mcl_potions._use_potion(itemstack, user, def.color)
|
||||
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)
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue