From 1ce07c063db4b4ea1ed22cec41c84b510330077b Mon Sep 17 00:00:00 2001 From: Eric Wald Date: Sun, 7 Sep 2014 14:55:34 -0600 Subject: [PATCH] Canonical way to find the stockpile by id. --- plugins/lua/stockflow.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/plugins/lua/stockflow.lua b/plugins/lua/stockflow.lua index 2f564cec1..86018e1ae 100644 --- a/plugins/lua/stockflow.lua +++ b/plugins/lua/stockflow.lua @@ -1,7 +1,6 @@ local _ENV = mkmodule('plugins.stockflow') local gui = require "gui" -local utils = require "utils" reaction_list = reaction_list or {} saved_orders = saved_orders or {} @@ -116,10 +115,9 @@ function collect_orders() local result = {} local entries = dfhack.persistent.get_all("stockflow/entry", true) if entries then - local stockpiles = df.global.world.buildings.other.STOCKPILE for _, entry in ipairs(entries) do local spid = entry.ints[entry_ints.stockpile_id] - local stockpile = utils.binsearch(stockpiles, spid, "id") + local stockpile = df.building.find(spid) if stockpile then local order_number = entry.ints[entry_ints.order_number] if reaction_list[order_number] and entry.value == reaction_list[order_number].name then