Deadlock989 / IndustrialRevolution

Industrial Revolution 3 is an overhaul mod for Factorio.
51 stars 0 forks source link

Crash with temporary station when 'Color trains' is ON #439

Closed searcher-123 closed 3 months ago

searcher-123 commented 3 months ago

Describe the issue If the Color trains parameter is enabled, and specify the points between stations for the train. state When the train reaches this point, an error occurs. error wo_stations With_stations

Factorio version, IR version Factorio 1.1.107 IR3 3.1.26

Other mods installed Some small mod - JetPack, many QoL. Full list modlist_all or just clean start game archive Ir3_.zip

I assume this is due to the fact that the temporary station does not have a backer_name field.

function CONTROL.train_changed_state(event) local enabled = (settings.global["ir-colour-trains"].value ~= "no") if enabled and event.train and event.train.valid and event.train.state == defines.train_state.wait_station then local stop = event.train.station local c = match_hue(stop.backer_name)

Deadlock989 commented 3 months ago

Good catch, fixed for next version.

I assume this is due to the fact that the temporary station does not have a backer_name field.

It's more fundamental than that - there is no "station" (i.e. event.train.station is nil) when the stop is temporary.

Deadlock989 commented 3 months ago

Made some additional changes and improvements to this option.