Modern Bulk Rail Loaders: Pooled

by Florby

Bulk train loading/unloading silos that share a single pooled inventory per station. Contents can never get unbalanced between wagons, so automated deliveries (e.g. Cybersyn) always complete when the station total suffices. Pooled-architecture rework inspired by Modern Bulk Rail Loader by Vyl.

Utilities
2 months ago
2.0
112
Transportation Trains

b Crash when clicking the Wagons: X label

a month ago

Mod version

Modern Bulk Rail Loaders: Pooled 0.1.0

Factorio version

2.0.77

Steps to reproduce

  1. Place a Bulk Rail Loader.
  2. Open its GUI.
  3. Click directly on the Wagons: 5 text label in the upper-left section of the GUI.
  4. The mod crashes immediately.

The crash does not occur by clicking the + or - buttons. It occurs when clicking the Wagons: 5 label itself.

Expected behavior

Clicking the text label should either do nothing or be ignored.

Actual behavior

The mod crashes with the following error:

Error while running event modern-bulk-rail-loader-pooled::on_gui_click (ID 1)
__modern-bulk-rail-loader-pooled__/control.lua:317: 'for' limit must be a number

stack traceback:
    __modern-bulk-rail-loader-pooled__/control.lua:317: in function 'wagon_offsets'
    __modern-bulk-rail-loader-pooled__/control.lua:392: in function 'rebuild_silos'
    __modern-bulk-rail-loader-pooled__/control.lua:568: in function <__modern-bulk-rail-loader-pooled__/control.lua:556>

It appears that the click event for the wagon count label is being handled as though it were one of the wagon count controls, resulting in a non-numeric value being passed to wagon_offsets().

New response