mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-17 21:25:40 +00:00
(svn r18461) -Fix (r18456): when moving a wagon from the front of a train one could make a train 1 longer than allowed
This commit is contained in:
parent
745a6d72d1
commit
db4e547e24
@ -1112,7 +1112,9 @@ static CommandCost CheckNewTrainLength(const Train *dst_head, const Train *src_h
|
||||
* will be within the required lengths. */
|
||||
if (src_len + dst_len <= max_len) return CommandCost();
|
||||
|
||||
if (!move_chain && !src_head->IsFrontEngine() && src_head == src && (src_len - 1) > max_len) {
|
||||
if (!move_chain && !src_head->IsFrontEngine() && src_head == src &&
|
||||
/* First case moving within, second is make a new one */
|
||||
(src_head == dst_head ? src_len : src_len - 1) > max_len) {
|
||||
/* Moving of a *single* non-engine at the front of the chain,
|
||||
* i.e. a free wagon list. If the next unit is an engine a new
|
||||
* train will be created instead of removing a vehicle from a
|
||||
|
Loading…
Reference in New Issue
Block a user