Skip to content

Commit cee8146

Browse files
committed
use a proper check
1 parent fb18d3f commit cee8146

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

technic/tools/prospector.lua

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@ technic.register_power_tool("technic:prospector", {
6868
return
6969
end
7070
local meta = toolstack:get_meta()
71-
local target = core.registered_nodes[meta:get("target") or migrate_meta(meta)]
71+
local target = meta:get("target") or migrate_meta(meta)
72+
if target and not core.registered_nodes[target] then
73+
target = nil
74+
end
7275
local look_depth, look_radius = get_field(meta)
7376
local pointed
7477
if pointed_thing.type == "node" then
@@ -85,7 +88,7 @@ technic.register_power_tool("technic:prospector", {
8588
"label[1,0;"..core.formspec_escape(toolstack:get_description()).."]"..
8689
(target and
8790
"label[0,1.5;"..S("Current target:").."]"..
88-
"label[0,2;"..core.formspec_escape(target.description).."]"..
91+
"label[0,2;"..core.formspec_escape(core.registered_nodes[target].description).."]"..
8992
"item_image[0,2.5;1,1;"..target.."]" or
9093
"label[0,1.5;"..S("No target set").."]")..
9194
(pointed and

0 commit comments

Comments
 (0)