Browse Source

get_flow_count should now support *FlowStatistics types

main
chksm 2 years ago
parent
commit
b36da79c04
  1. 8
      script/fetcher.lua

8
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

Loading…
Cancel
Save