From 3f6bcb065c46cd684e8162870462c58108d35218 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sun, 12 Mar 2023 17:09:54 +0100 Subject: [PATCH] Fix electronic point teleporter crashing --- README.md | 2 +- init.lua | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4761a3a..9f864aa 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Point Teleporter [teletool] -Version: 1.3 +Version: 1.4 ## Description diff --git a/init.lua b/init.lua index df78f0f..22e700e 100644 --- a/init.lua +++ b/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