From 521c0b74bba5dd73cf7c0a59fde4a018813e835d Mon Sep 17 00:00:00 2001
From: SmallJoker <mk939@ymail.com>
Date: Thu, 24 Nov 2022 21:49:20 +0100
Subject: [PATCH] Fix battery box charging on Windows

---
 technic/machines/switching_station.lua |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/technic/machines/switching_station.lua b/technic/machines/switching_station.lua
index bd34a0a..e97e761 100644
--- a/technic/machines/switching_station.lua
+++ b/technic/machines/switching_station.lua
@@ -134,7 +134,8 @@
 	--dprint(name.." is a "..machines[name])
 	local meta = minetest.get_meta(pos)
 	-- Normal tostring() does not have enough precision, neither does meta:set_int()
-	meta:set_string(network.tier.."_network", string.format("%X", network_id))
+	-- Bug: Cannot use hexadecimal notation for compression (LuaJIT Windows bug, #911)
+	meta:set_string(network.tier.."_network", string.format("%.20g", network_id))
 
 	if     eu_type == technic.producer then
 		add_network_node(network.PR_nodes, pos, network_id)

--
Gitblit v1.8.0