Chunnel: Fix swap of vehicle chunnel flag when reversing consist.

This commit is contained in:
Jonathan G Rennison 2017-03-27 18:34:55 +01:00
parent 612c825bb6
commit c882082467

View File

@ -1635,8 +1635,10 @@ static void SwapTrainFlags(uint16 *swap_flag1, uint16 *swap_flag2)
/* Clear the flags */ /* Clear the flags */
ClrBit(*swap_flag1, GVF_GOINGUP_BIT); ClrBit(*swap_flag1, GVF_GOINGUP_BIT);
ClrBit(*swap_flag1, GVF_GOINGDOWN_BIT); ClrBit(*swap_flag1, GVF_GOINGDOWN_BIT);
ClrBit(*swap_flag1, GVF_CHUNNEL_BIT);
ClrBit(*swap_flag2, GVF_GOINGUP_BIT); ClrBit(*swap_flag2, GVF_GOINGUP_BIT);
ClrBit(*swap_flag2, GVF_GOINGDOWN_BIT); ClrBit(*swap_flag2, GVF_GOINGDOWN_BIT);
ClrBit(*swap_flag2, GVF_CHUNNEL_BIT);
/* Reverse the rail-flags (if needed) */ /* Reverse the rail-flags (if needed) */
if (HasBit(flag1, GVF_GOINGUP_BIT)) { if (HasBit(flag1, GVF_GOINGUP_BIT)) {
@ -1649,6 +1651,12 @@ static void SwapTrainFlags(uint16 *swap_flag1, uint16 *swap_flag2)
} else if (HasBit(flag2, GVF_GOINGDOWN_BIT)) { } else if (HasBit(flag2, GVF_GOINGDOWN_BIT)) {
SetBit(*swap_flag1, GVF_GOINGUP_BIT); SetBit(*swap_flag1, GVF_GOINGUP_BIT);
} }
if (HasBit(flag1, GVF_CHUNNEL_BIT)) {
SetBit(*swap_flag2, GVF_CHUNNEL_BIT);
}
if (HasBit(flag2, GVF_CHUNNEL_BIT)) {
SetBit(*swap_flag1, GVF_CHUNNEL_BIT);
}
} }
/** /**