diff --git a/script/fetcher.lua b/script/fetcher.lua index 60440c7..6495907 100644 --- a/script/fetcher.lua +++ b/script/fetcher.lua @@ -56,7 +56,8 @@ this.callOverlayFunction = function(functionName, callback, name, parent, args) end -- flow statistics - elseif functionName == "get_flow_count" and (parent.object_name == "LuaFlowStatistics" or parent.object_name == "LuaItemProductionFlowStatistics") then + -- worst hack to validate that parent inherits from FlowStatistics + elseif functionName == "get_flow_count" and string.sub(parent.object_name, -14) == "FlowStatistics" then if args[2] == 'input' then isInput = true else isInput = false end @@ -83,6 +84,11 @@ this.callOverlayFunction = function(functionName, callback, name, parent, args) end + elseif functionName == "get_flow_count" then + + game.players[1].print("Cannot get_flow_count for unexpected instance of:") + game.players[1].print(parent.object_name) + end end