From 3f0857bff3eea450adce702973e850fc97e7c848 Mon Sep 17 00:00:00 2001 From: Eric Wald Date: Sun, 15 May 2016 22:47:43 -0600 Subject: [PATCH] Incrementing the manager order id properly. There's a chance that not doing so could lead to a crash, somehow. --- library/xml | 2 +- plugins/lua/stockflow.lua | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/library/xml b/library/xml index 82e00df85..23edfbdfa 160000 --- a/library/xml +++ b/library/xml @@ -1 +1 @@ -Subproject commit 82e00df85ec147a4a6263f93b03421d76eb24fe0 +Subproject commit 23edfbdfadd5f5599c0ce4a5e06ee68e9472d30b diff --git a/plugins/lua/stockflow.lua b/plugins/lua/stockflow.lua index 9a5a4f080..4d7889843 100644 --- a/plugins/lua/stockflow.lua +++ b/plugins/lua/stockflow.lua @@ -1098,6 +1098,8 @@ function create_orders(order, amount) -- Todo: Create in a validated state if the fortress is small enough? new_order.status.validated = false new_order.status.active = false + new_order.id = df.global.world.manager_order_next_id + df.global.world.manager_order_next_id = df.global.world.manager_order_next_id + 1 df.global.world.manager_orders:insert('#', new_order) end