Fix failure sound for technic teletool

master
Wuzzy 2015-02-16 01:02:26 +01:00
parent a5ab1498e5
commit 596c9a88c9
1 changed files with 3 additions and 2 deletions

View File

@ -79,8 +79,9 @@ if(minetest.get_modpath("technic")) then
local failure = false
if(pointed_thing.type == "node") then
local meta = minetest.deserialize(itemstack:get_metadata())
if not meta or not meta.charge then return end
if meta.charge >= 1000 then
if not meta or not meta.charge then
failure = true
elseif meta.charge >= 1000 then
meta.charge = meta.charge - 1000
teletool.teleport(user, pointed_thing)
technic.set_RE_wear(itemstack, meta.charge, 50000)