Fix electronic point teleporter crashing
This commit is contained in:
parent
ebd18bf3df
commit
3f6bcb065c
@ -1,6 +1,6 @@
|
||||
# Point Teleporter [teletool]
|
||||
|
||||
Version: 1.3
|
||||
Version: 1.4
|
||||
|
||||
## Description
|
||||
|
||||
|
8
init.lua
8
init.lua
@ -117,9 +117,9 @@ minetest.register_tool("teletool:teletool_infinite", {
|
||||
if(minetest.get_modpath("technic")) then
|
||||
technic.register_power_tool("teletool:teletool_technic", 50000)
|
||||
|
||||
local technic = S("Electronic point teleporters run on electricity and must be charged initially. Fully charged, they can be used about 50 times.")
|
||||
local technichelp = S("Electronic point teleporters run on electricity and must be charged initially. Fully charged, they can be used about 50 times.")
|
||||
local technicuse = S("To recharge this tool, place it in a powered battery box.")
|
||||
local desc_technic = base .. "\n" .. technic
|
||||
local desc_technic = base .. "\n" .. technichelp
|
||||
local use_technic = technicuse .. " " .. baseuse
|
||||
|
||||
minetest.register_tool("teletool:teletool_technic", {
|
||||
@ -141,7 +141,7 @@ if(minetest.get_modpath("technic")) then
|
||||
elseif meta.charge >= 1000 then
|
||||
meta.charge = meta.charge - 1000
|
||||
failure = not teletool.teleport(user, pointed_thing)
|
||||
if not failure then
|
||||
if not failure and not technic.creative_mode then
|
||||
technic.set_RE_wear(itemstack, meta.charge, 50000)
|
||||
itemstack:set_metadata(minetest.serialize(meta))
|
||||
end
|
||||
@ -160,7 +160,7 @@ if(minetest.get_modpath("technic")) then
|
||||
|
||||
-- Technic data
|
||||
wear_represents = "technic_RE_charge",
|
||||
on_refill = technic.refill_RE_charge
|
||||
on_refill = technic.refill_RE_charge,
|
||||
})
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user