diff --git a/control.lua b/control.lua index c44b1a5..515bb1f 100644 --- a/control.lua +++ b/control.lua @@ -10,6 +10,7 @@ udpAddress = 52555 isInitialized = false sendIndex = 0 serverIndex = 0 +LabsScanned = false options = { enableMod = false, @@ -141,10 +142,10 @@ function SendAll(event) if game.is_multiplayer() then serverIndex = 0 log("Loaded game as mulitplayer") - end - else + else log("Loaded game as singleplayer") serverIndex = 1 + end end isInitialized = true @@ -156,7 +157,7 @@ function SendAll(event) if LabsScanned == false then GenerateLabInfo() -end + end if options.enableMod==true then diff --git a/info.json b/info.json index 7066a19..c27c776 100644 --- a/info.json +++ b/info.json @@ -1,6 +1,6 @@ { "name": "factorio-metrics-exporter", - "version": "0.1.4", + "version": "0.1.5", "title": "Prometheus Metrics Exporter", "author": "Jan Grießhaber", "contact": "jan@griesshaber.systems", diff --git a/research-stats.lua b/research-stats.lua index 37e65d8..913a33b 100644 --- a/research-stats.lua +++ b/research-stats.lua @@ -6,6 +6,7 @@ LabsScanned = false function GenerateLabInfo() + storage.labs = {} for _, surface in pairs(game.surfaces) do local labs = surface.find_entities_filtered({type="lab"}) for index, lab in pairs(labs) do