Fix mana being subtracted for invalid teleport
This commit is contained in:
parent
5216fb3b83
commit
bdf22735c6
5
init.lua
5
init.lua
@ -155,8 +155,11 @@ if(minetest.get_modpath("mana") ~= nil) then
|
||||
on_use = function(itemstack, user, pointed_thing)
|
||||
local failure = false
|
||||
if(pointed_thing.type == "node") then
|
||||
if(mana.subtract(user:get_player_name(), teletool.settings.cost_mana)) then
|
||||
if(mana.get(user:get_player_name()) >= teletool.settings.cost_mana) then
|
||||
failure = not teletool.teleport(user, pointed_thing)
|
||||
if not failure then
|
||||
failure = mana.subtract(user:get_player_name(), teletool.settings.cost_mana)
|
||||
end
|
||||
else
|
||||
failure = true
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user