Warning about mismatched stockflow entries.

For the most part, mismatches should only happen if the reaction list has changed between world loads, which means either the raw files or the plugin files have been changed.  For now, such entries are ignored, though in some cases it might be possible to recover a new order number by searching through the reaction list.
develop
Eric Wald 2014-08-03 15:04:28 -06:00
parent 2db1c9d722
commit 1b1475fb94
1 changed files with 11 additions and 5 deletions

@ -121,11 +121,17 @@ function collect_orders()
local spid = entry.ints[entry_ints.stockpile_id]
local stockpile = utils.binsearch(stockpiles, spid, "id")
if stockpile then
-- Todo: What if entry.value ~= reaction_list[order_number].name?
result[spid] = {
stockpile = stockpile,
entry = entry,
}
local order_number = entry.ints[entry_ints.order_number]
if reaction_list[order_number] and entry.value == reaction_list[order_number].name then
result[spid] = {
stockpile = stockpile,
entry = entry,
}
else
-- It might be worth searching reaction_list for the name.
-- Then again, this should only happen in unusual situations.
print("Mismatched stockflow entry for stockpile #"..stockpile.stockpile_number..": "..entry.value.." ("..order_number..")")
end
end
end
end