From 7df26a2cc70ed4439c37f30416788152282c2a7a Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Sat, 2 May 2020 00:02:42 +0100 Subject: [PATCH] raycast_polyfill: ignore wielded_light:* nodes. .....this means that despite this being a polyfill, we now can't replace it with the Minetest built-in version. We'd have to benchmark - I'm not actually sure which is faster. On the 1 hand, Minetest.raycast() is a C++ call and staying in Lua gives us an advantage, but on the other hand Lua might be that much slower than C++ that it's worth the hit of making an extra API call. --- hud_info.lua | 2 +- raycast_polyfill.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hud_info.lua b/hud_info.lua index e94a85c..2cc9007 100644 --- a/hud_info.lua +++ b/hud_info.lua @@ -64,7 +64,7 @@ local function handle_rotation_player(player) local rotation = player:get_look_horizontal() local old_rotation = worldedit_hud_helper.info[player_name].rotation - -- Bad practice! Lua doesn't have a contineu statement though (O.o), + -- Bad practice! Lua doesn't have a continue statement though (O.o), -- so we've got to make do :-/ if rotation ~= old_rotation then local rotation_text = calc_rotation_text(rotation) diff --git a/raycast_polyfill.lua b/raycast_polyfill.lua index c07e7d7..8646402 100644 --- a/raycast_polyfill.lua +++ b/raycast_polyfill.lua @@ -15,7 +15,7 @@ function worldedit_hud_helper.raycast(player) local node_name node_name = minetest.get_node(cur_pos).name - if node_name ~= "air" and node_name ~= "ignore" then + if node_name ~= "air" and node_name ~= "ignore" and not string.match(node_name, "wielded_light:") then return node_name end end