Skip to content

Commit 1073727

Browse files
committed
correct variable name to elevator animation heights
1 parent 9484f2d commit 1073727

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Core/Objects/BuildingObject.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public record BuildingObject(
4646
[property: LocoStructOffset(0xA4), LocoStructVariableLoad, LocoArrayLength(2)] List<uint8_t> var_A4, // Some type of Cargo
4747
[property: LocoStructOffset(0xAA)] int16_t DemolishRatingReduction,
4848
[property: LocoStructOffset(0xAC)] uint8_t var_AC,
49-
[property: LocoStructOffset(0xAD)] uint8_t NumAnimationSequences
49+
[property: LocoStructOffset(0xAD)] uint8_t NumAnimatedElevators
5050
//[property: LocoStructOffset(0xAE), LocoStructVariableLoad, LocoArrayLength(4)] uint8_t[][] var_AE // 0xAE ->0xB2->0xB6->0xBA->0xBE (4 byte pointers)
5151
) : ILocoStruct, ILocoStructVariableData
5252
{
@@ -57,7 +57,7 @@ public record BuildingObject(
5757
public List<S5Header> ProducedCargo { get; set; } = [];
5858
public List<S5Header> RequiredCargo { get; set; } = [];
5959

60-
public List<uint8_t[]> AnimationSequences { get; set; } = [];
60+
public List<uint8_t[]> ElevatorAnimationHeights { get; set; } = [];
6161

6262
// known issues:
6363
// HOSPITL1.dat - loads without error but graphics are bugged
@@ -101,13 +101,13 @@ public ReadOnlySpan<byte> Load(ReadOnlySpan<byte> remainingData)
101101
remainingData = remainingData[(S5Header.StructLength * MaxRequiredCargoType)..];
102102

103103
// animation sequences
104-
AnimationSequences.Clear();
105-
for (var i = 0; i < NumAnimationSequences; ++i)
104+
ElevatorAnimationHeights.Clear();
105+
for (var i = 0; i < NumAnimatedElevators; ++i)
106106
{
107107
var size = BitConverter.ToUInt16(remainingData[..2]);
108108
remainingData = remainingData[2..];
109109

110-
AnimationSequences.Add(remainingData[..size].ToArray());
110+
ElevatorAnimationHeights.Add(remainingData[..size].ToArray());
111111
remainingData = remainingData[size..];
112112
}
113113

@@ -150,7 +150,7 @@ public ReadOnlySpan<byte> Save()
150150
ms.Write(obj.Write());
151151
}
152152

153-
foreach (var unk in AnimationSequences)
153+
foreach (var unk in ElevatorAnimationHeights)
154154
{
155155
ms.Write(BitConverter.GetBytes((uint16_t)unk.Length));
156156
foreach (var x in unk)

Tests/LoadSaveTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ void assertFunc(ILocoObject obj, BuildingObject struc) => Assert.Multiple(() =>
179179
// CollectionAssert.AreEqual(struc.var_A4, Array.CreateInstance(typeof(byte), 2), nameof(struc.var_A4));
180180
Assert.That(struc.DemolishRatingReduction, Is.EqualTo(0), nameof(struc.DemolishRatingReduction));
181181
Assert.That(struc.var_AC, Is.EqualTo(255), nameof(struc.var_AC));
182-
Assert.That(struc.NumAnimationSequences, Is.EqualTo(0), nameof(struc.NumAnimationSequences));
182+
Assert.That(struc.NumAnimatedElevators, Is.EqualTo(0), nameof(struc.NumAnimatedElevators));
183183
});
184184
LoadSaveGenericTest<BuildingObject>(objectName, assertFunc);
185185
}

0 commit comments

Comments
 (0)