Skip to content

Commit a41f3cf

Browse files
committed
add ship wake offset
1 parent bb7abe5 commit a41f3cf

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Dat/Objects/Vehicle/VehicleObject.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ public record VehicleObject(
3838
[property: LocoStructOffset(0xEC), LocoArrayLength(VehicleObject.CargoTypeSpriteOffsetsLength), LocoStructVariableLoad] Dictionary<CargoCategory, uint8_t> CargoTypeSpriteOffsets,
3939
[property: LocoStructOffset(0x10C), LocoStructVariableLoad, Browsable(false)] uint8_t _NumSimultaneousCargoTypes,
4040
[property: LocoStructOffset(0x10D), LocoArrayLength(VehicleObject.AnimationCount)] SimpleAnimation[] Animation,
41-
[property: LocoStructOffset(0x113)] uint8_t var_113,
41+
[property: LocoStructOffset(0x113)] uint8_t ShipWakeOffset, // the distance between each wake of the boat. 0 will be a single wake. anything > 0 gives dual wakes
4242
[property: LocoStructOffset(0x114)] uint16_t DesignedYear,
4343
[property: LocoStructOffset(0x116)] uint16_t ObsoleteYear,
44-
[property: LocoStructOffset(0x118), LocoStructVariableLoad, Browsable(false)] object_id RackRailType,
44+
[property: LocoStructOffset(0x118), LocoStructVariableLoad, Browsable(false)] object_id RackRailType, // also airport taxi speed
4545
[property: LocoStructOffset(0x119)] DrivingSoundType DrivingSoundType,
4646
// this is a union...length is the length of the longest union struct, which is Engine2Sound. make the byte[] not visible in editor
4747
[property: LocoStructOffset(0x11A), LocoArrayLength(VehicleObject.MaxUnionSoundStructLength), Browsable(false)] byte[] SoundPropertiesData,

Gui/ViewModels/DatTypes/Objects/VehicleViewModel.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ public class VehicleViewModel : LocoObjectViewModel<VehicleObject>
2626
[Reactive, Range(0, 4)] public uint8_t NumCarComponents { get; set; }
2727
[Reactive, Length(0, 8)] public BindingList<S5HeaderViewModel> CompatibleVehicles { get; set; }
2828
[Reactive, Length(0, 4)] public BindingList<S5HeaderViewModel> RequiredTrackExtras { get; set; }
29+
[Reactive, Description("If 0, boat has a single wake animation. if > 0, boat has 2 wakes, offset horizontally by this value")] public uint8_t ShipWakeOffset { get; set; }
2930
[Reactive, Category("Cost"), Range(0, 32)] public uint8_t CostIndex { get; set; }
3031
[Reactive, Category("Cost"), Range(1, int16_t.MaxValue)] public int16_t CostFactor { get; set; }
3132
[Reactive, Category("Cost"), Range(0, 32)] public uint8_t RunCostIndex { get; set; }
3233
[Reactive, Category("Cost"), Range(0, int16_t.MaxValue)] public int16_t RunCostFactor { get; set; }
33-
[Reactive, Category("<unknown>")] public uint8_t var_113 { get; set; }
3434
[Reactive, Category("Sprites")] public CompanyColourType SpecialColourSchemeIndex { get; set; } // called "ColourType" in the loco codebase
3535
[Reactive, Category("Sprites"), Editable(false)] public BindingList<VehicleObjectCar> CarComponents { get; set; }
3636
[Reactive, Category("Sprites"), Editable(false)] public BindingList<BodySprite> BodySprites { get; set; }
@@ -79,7 +79,7 @@ public VehicleViewModel(VehicleObject vo)
7979
CargoTypeSpriteOffsets = new(vo.CargoTypeSpriteOffsets.Select(x => new CargoTypeSpriteOffset(x.Key, x.Value)).ToList());
8080
Animation = new(vo.Animation);
8181
AnimationHeaders = new(vo.AnimationHeaders.ConvertAll(x => new S5HeaderViewModel(x)));
82-
var_113 = vo.var_113;
82+
ShipWakeOffset = vo.ShipWakeOffset;
8383
DesignedYear = vo.DesignedYear;
8484
ObsoleteYear = vo.ObsoleteYear;
8585
RackRail = vo.RackRail == null ? null : new(vo.RackRail);
@@ -115,7 +115,7 @@ public override VehicleObject GetAsStruct(VehicleObject vo)
115115
RackSpeed = RackSpeed,
116116
Weight = Weight,
117117
Flags = Flags,
118-
var_113 = var_113,
118+
ShipWakeOffset = ShipWakeOffset,
119119
DesignedYear = DesignedYear,
120120
ObsoleteYear = ObsoleteYear,
121121
RackRail = RackRail?.GetAsUnderlyingType(),

Tests/LoadSaveTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1027,7 +1027,7 @@ void assertFunc(ILocoObject obj, VehicleObject struc) => Assert.Multiple(() =>
10271027
Assert.That(struc.Animation[1].ObjectId, Is.EqualTo(0), nameof(struc.Animation));
10281028
Assert.That(struc.Animation[1].Height, Is.EqualTo(0), nameof(struc.Animation));
10291029
Assert.That(struc.Animation[1].Type, Is.EqualTo(SimpleAnimationType.None), nameof(struc.Animation));
1030-
Assert.That(struc.var_113, Is.EqualTo(0), nameof(struc.var_113));
1030+
Assert.That(struc.ShipWakeOffset, Is.EqualTo(0), nameof(struc.ShipWakeOffset));
10311031
Assert.That(struc.DesignedYear, Is.EqualTo(1957), nameof(struc.DesignedYear));
10321032
Assert.That(struc.ObsoleteYear, Is.EqualTo(1987), nameof(struc.ObsoleteYear));
10331033
Assert.That(struc.RackRailType, Is.EqualTo(0), nameof(struc.RackRailType));

0 commit comments

Comments
 (0)