Train Skip Fulfilled Station


Changes trains behavior so they will skip a station if the "wait until" condition is already met

Content
3 years ago
0.15 - 1.1
5.09K
Trains

b And/or setting of first condition needs to be ignored

3 years ago
(updated 3 years ago)

By default the first condition has a hidden "or" compare type, but by shuffling around the conditions it can have an "and" as well. Then the IsAllFulfilled logic does not work right. It should ignore the setting of the first condition and always consider it to be "or":

--- control.lua.orig    2021-01-06 01:29:00.000000000 +0100
+++ control.lua 2021-01-06 11:19:55.010280729 +0100
@@ -65,7 +65,7 @@
         for i = #wait_conditions, 1, -1 do
             local wait_condition = wait_conditions[i]
             and_result = and_result and IsFulfilled(train, station, wait_condition)
-            if wait_condition.compare_type == "or" then
+            if i == 1 or wait_condition.compare_type == "or" then
                 if and_result then
                     return true
                 else
3 years ago

Thank you

New response