Skip to content

Commit 3f0857b

Browse files
committed
Incrementing the manager order id properly.
There's a chance that not doing so could lead to a crash, somehow.
1 parent a8f9f91 commit 3f0857b

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

library/xml

plugins/lua/stockflow.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,6 +1098,8 @@ function create_orders(order, amount)
10981098
-- Todo: Create in a validated state if the fortress is small enough?
10991099
new_order.status.validated = false
11001100
new_order.status.active = false
1101+
new_order.id = df.global.world.manager_order_next_id
1102+
df.global.world.manager_order_next_id = df.global.world.manager_order_next_id + 1
11011103
df.global.world.manager_orders:insert('#', new_order)
11021104
end
11031105

0 commit comments

Comments
 (0)