[0.13.20] manual_control_stop is never triggered
Posted: Wed Oct 12, 2016 10:54 pm
I found out, that the train_state is not triggered correctly.
The train state manual_control_stop is never triggered. Instead the manual_control is always triggered, when the train runs on manual.
Code example:
Without the if the output is always "9" when the train runs on manual. With the if it is either 8 or 9. Maybe it's already working in 0.14 but I didn't found a bug report about this.
The train state manual_control_stop is never triggered. Instead the manual_control is always triggered, when the train runs on manual.
Code example:
Code: Select all
script.on_event(defines.events.on_train_changed_state, function(event)
log(convertState(event.train))
end
function convertState(train)
local state = train.state
if state == defines.train_state.manual_control and train.speed == 0 then
return defines.train_state.manual_control_stop
end
return state
end