Fix electronic point teleporter crashing

This commit is contained in:
Wuzzy 2023-03-12 17:09:54 +01:00
parent ebd18bf3df
commit 3f6bcb065c
2 changed files with 5 additions and 5 deletions

View File

@ -1,6 +1,6 @@
# Point Teleporter [teletool] # Point Teleporter [teletool]
Version: 1.3 Version: 1.4
## Description ## Description

View File

@ -117,9 +117,9 @@ minetest.register_tool("teletool:teletool_infinite", {
if(minetest.get_modpath("technic")) then if(minetest.get_modpath("technic")) then
technic.register_power_tool("teletool:teletool_technic", 50000) 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 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 local use_technic = technicuse .. " " .. baseuse
minetest.register_tool("teletool:teletool_technic", { minetest.register_tool("teletool:teletool_technic", {
@ -141,7 +141,7 @@ if(minetest.get_modpath("technic")) then
elseif meta.charge >= 1000 then elseif meta.charge >= 1000 then
meta.charge = meta.charge - 1000 meta.charge = meta.charge - 1000
failure = not teletool.teleport(user, pointed_thing) 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) technic.set_RE_wear(itemstack, meta.charge, 50000)
itemstack:set_metadata(minetest.serialize(meta)) itemstack:set_metadata(minetest.serialize(meta))
end end
@ -160,7 +160,7 @@ if(minetest.get_modpath("technic")) then
-- Technic data -- Technic data
wear_represents = "technic_RE_charge", wear_represents = "technic_RE_charge",
on_refill = technic.refill_RE_charge on_refill = technic.refill_RE_charge,
}) })
end end