[Rseding91] [2.1.11] apply_upgrade() on train via script or robot disconnects on junction

Bugs which we just recently fixed in our development version and will reach you in the next release.
robot256
Smart Inserter
Smart Inserter
Posts: 1424
Joined: Sun Mar 17, 2019 1:52 am
Contact:

[Rseding91] [2.1.11] apply_upgrade() on train via script or robot disconnects on junction

Post by robot256 »

When a train is parked on a junction of a straight and curved track, only placing an upgrade manually is guaranteed to reconnect to the train properly. Both robots and scripts can end up on the wrong track and not couple to the original train, even though an in-place upgrade was ordered.

Steps to reproduce:

1. Load the attached save.
2. Take the Epic Locomotive from your hotbar and place it on the right-most locomotive. Observe that the locomotive remains coupled to the train. This is expected.

3. Reload the attached save.
4. Take the Rare Locomotive Upgrade Planner from your hotbar and order an upgrade of the right-most locomotive to order an upgrade. Observe that after the construction bot places it, the locomotive becomes uncoupled from the train. I expected it to remain coupled.

5. Reload the attached save.
6. Disable your personal roboport.
7. Take the Rare Locomotive Upgrade Planner from your hotbar and order an upgrade of the right-most locomotive to order an upgrade.
8. Select the to-be-upgraded locomotive and run the following command: /c game.player.selected.apply_upgrade(). Observe that the locomotive becomes uncoupled from the train. I expected it to remain coupled.

9. Reload the attached save.
10. Select the right-most locomotive and run the following command: /c game.player.selected.apply_upgrade({name="locomotive", quality="rare"}). Observe that the locomotive becomes uncoupled from the train. I expected it to remain coupled.

FYI, using create_entity has always done the same thing, disconnecting the train on certain junctions. I was hoping that apply_upgrade would fix this problem, which continues to cause issues with Multiple Unit Train Control and Vehicle Wagon.
Attachments
train_upgrade_on_junction.zip
(2 MiB) Downloaded 8 times
My mods: Multiple Unit Train Control, RGB Pipes, Shipping Containers, Rocket Log, Smart Artillery Wagons.
Maintainer of Auto Deconstruct, Cargo Ships, Vehicle Wagon, Honk, Shortwave.
Rseding91
Factorio Staff
Factorio Staff
Posts: 17226
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [Rseding91] [2.1.11] apply_upgrade() on train via script or robot disconnects on junction

Post by Rseding91 »

Thanks for the report. This is now fixed for the next release.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Resolved for the next release”