Turn multi-car units as a whole when orientation is randomised or a unit swapped

Randomising flipped only the card's flag, so a multi-car unit was exported
with its cars in reverse order but each still facing forward - coupled back
to front. A swap copied the flag without turning the new cars. Both now turn
flag, cars and order together, as Flip does, and a locked unit as one.
This commit is contained in:
maj00r
2026-10-04 13:54:51 +02:00
parent c1c47f746e
commit d510a55740
5 changed files with 133 additions and 19 deletions

View File

@@ -56,7 +56,7 @@ public partial class Depot : UserControl
public Depot()
{
_info = new VehicleInfo(_db);
_info = new VehicleInfo(_db, AppServices.Current.Physics);
_consist = new Consist(_db, _info);
_cargo = new Cargo(_info, _rng);
_consist.Changed += RebuildConsist;
@@ -572,8 +572,7 @@ public partial class Depot : UserControl
var item = new ConsistItem
{
Cars = unit.Select(NewVehicle).ToList(),
Grouped = unit.Count > 1,
Flipped = _consist.Selected.Flipped
Grouped = unit.Count > 1
};
_consist.Replace(i, item);
_consist.Selected = item;