-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Station correcting overload causes missing cargo warning #252
Comments
That's some interesting interaction between alerts and some 3 year old code. If I didn't update delivery with train inventory during stop update LTN will not see overloaded shipments in time resulting in it sending a train to pick up items already loaded in the first train. Update: |
Thank you for the explanation! That makes sense. Sorry for the slow reply. Might I be so rude as to suggest possible fixes (not in any particular order):
Some of these I might be able to implement myself (certainly the last one), so let me know if you prefer a pull request. |
Best solution would be if you built a station loading only requested amount without removing items. |
I'm running into this in my game as well, the missing cargo warnings are pretty annoying and are also incorrect. They don't reflect the original requested values, which are satisfied properly. So this seems like an actual bug worth fixing in the mod. I've implemented the suggestion you've made above in a local clone (the solution of keeping the original request info alongside the inventory), and it seems to be working fine. Let me know if you'd like a PR for the changes. |
I'm also running into this. A loading station that overloads and then corrects may be wrong, but the existing message is also wrong. |
Intro
Love your mod!
I tried to make this bug report as detailed as possible, please forgive my mistakes and keep up the great work!
Bug description
If a train is overloaded at a station and the overloaded items are then removed again, then the
ltn-message.provider_missing_cargo
might appear even if the actual contents are still more than the original request.Lines causing the warning:
https://github.com/Yousei9/Logistic-Train-Network/blob/1d237981a0da80b6d6911d5a589f77ee4a7bd2cf/script/train-events.lua#L183-L186
https://github.com/Yousei9/Logistic-Train-Network/blob/1d237981a0da80b6d6911d5a589f77ee4a7bd2cf/script/train-events.lua#L213-L216
I don't think this causes the problem.
Lines updating the delivery:
https://github.com/Yousei9/Logistic-Train-Network/blob/1d237981a0da80b6d6911d5a589f77ee4a7bd2cf/script/stop-update.lua#L289-L293
Introduced in:
https://github.com/Yousei9/Logistic-Train-Network/blob/da3676c944be490aa8164a4783248b379ee44cd0/control.lua#L1253-L1257
The commit message was:
The previous behavior describes what I expect the mod to do, the updated behavior describes the cause of the bug (in my opinion). I am not sure where to find the reason of this change. Please forgive me if I missed something obvious.
The delivery is increased to match the overload whenever it occurs, which means that any overload correction (reducing the contents of a train) by the player will generate warnings even if the contents is more than the original request.
Expected behaviour
The station provides the requested amount, so anything equal to or more than than that should be acceptable. This is why I do not expect the missing cargo warning.
Reducing the train overload is important if the requested item is costly to produce. You would not want to overload nuclear reactors.
Also, a station with both loading and unloading is easier to create if it does not have to check if an item is unnecessary or just overloaded.
To Reproduce
Savegame with example station: ltn-test.zip
Might not provide instant results, so please wait for about 3 deliveries.
Alternatively, create a station that loads with (stack) inserters and unloads the overloaded materials.
LTN version
1.15.2
Log file
factorio-current.log
Extra logging of all deliveries included. Also logs the expected vs. actual amount if there is missing cargo.
Lines added to
dispatcher.lua:24
:Line added to
train-events.lua:184
:Timestamps of an erroneous run:
The text was updated successfully, but these errors were encountered: