[1.1.104] Pumps stop working when mod replaces connected wagon
Posted: Fri Mar 15, 2024 9:44 pm
Problem:
When a pump is pumping fluid either to or from a train wagon, and a mod swaps it with another fluid-wagon entity, the pump will stop working. For cargo wagons, the inserters continue to work fine when the cargo-wagon entity is swapped.
Affected mod:
https://mods.factorio.com/mod/TrainMass
How to reproduce:
- Install mod TrainMass
- Put a locomotive + fluid-wagon on rails.
- Pump any fluid into the wagon (at least 1000L, which is guaranteed to trigger the entity-swap).
- The pump remains in the attached-state, but does not pump any fluids.
- The mod currently already implemented a workaround, by swapping the pumps too, which can be disabled by clearing out the implementation of the function recreatePump(...) in control.lua - after that you will see the pump getting stuck.
Reproducability: always.
Workaround:
My mod replaces the connected pumps in the same tick that the wagons are replaced. However, this shows the attaching-animation, and incurs a time delay before the pumping is resumed.
Solution:
A. The pump would continue to transfer fluids into the new fluid-wagon.
B. The pump would detach and re-attach.
When a pump is pumping fluid either to or from a train wagon, and a mod swaps it with another fluid-wagon entity, the pump will stop working. For cargo wagons, the inserters continue to work fine when the cargo-wagon entity is swapped.
Affected mod:
https://mods.factorio.com/mod/TrainMass
How to reproduce:
- Install mod TrainMass
- Put a locomotive + fluid-wagon on rails.
- Pump any fluid into the wagon (at least 1000L, which is guaranteed to trigger the entity-swap).
- The pump remains in the attached-state, but does not pump any fluids.
- The mod currently already implemented a workaround, by swapping the pumps too, which can be disabled by clearing out the implementation of the function recreatePump(...) in control.lua - after that you will see the pump getting stuck.
Reproducability: always.
Workaround:
My mod replaces the connected pumps in the same tick that the wagons are replaced. However, this shows the attaching-animation, and incurs a time delay before the pumping is resumed.
Solution:
A. The pump would continue to transfer fluids into the new fluid-wagon.
B. The pump would detach and re-attach.