mamoniot / project-cybersyn

MIT License
43 stars 37 forks source link

fixed provide/request orders for the same item getting generated simultaneously #121

Closed jagoly closed 11 months ago

jagoly commented 11 months ago

I believe this should prevent https://github.com/mamoniot/project-cybersyn/issues/120 from happening in the future. The issue was that for stations set to both provide and request, changing the request targets or overfilling stations could result in provide/request orders being generated at the same time, which would then cancel each other out, causing the deliveries entry to be set to nil and later causing crashes.

Note that this fix won't fix saves already experiencing this issue, so we may want to add something to migrations for those cases? I'm pretty sure this issue is pretty rare and everyone who has experienced it has just rolled back to an autosave.