@@ -26,7 +26,7 @@ public record BuildingObject(
26
26
[ property: LocoStructOffset ( 0x07 ) ] uint8_t NumBuildingVariations ,
27
27
[ property: LocoStructOffset ( 0x08 ) , LocoStructVariableLoad , LocoArrayLength ( BuildingObject . BuildingHeightCount ) ] List < uint8_t > BuildingHeights ,
28
28
[ property: LocoStructOffset ( 0x0C ) , LocoStructVariableLoad , LocoArrayLength ( BuildingObject . BuildingAnimationCount ) ] List < BuildingPartAnimation > BuildingAnimations ,
29
- [ property: LocoStructOffset ( 0x10 ) , LocoStructVariableLoad , LocoArrayLength ( BuildingObject . BuildingVariationCount ) ] List < uint8_t [ ] > BuildingVariations ,
29
+ [ property: LocoStructOffset ( 0x10 ) , LocoStructVariableLoad , LocoArrayLength ( BuildingObject . BuildingVariationCount ) ] List < List < uint8_t > > BuildingVariations ,
30
30
[ property: LocoStructOffset ( 0x90 ) ] uint32_t Colours ,
31
31
[ property: LocoStructOffset ( 0x94 ) ] uint16_t DesignedYear ,
32
32
[ property: LocoStructOffset ( 0x96 ) ] uint16_t ObsoleteYear ,
@@ -37,7 +37,7 @@ public record BuildingObject(
37
37
[ property: LocoStructOffset ( 0x9D ) ] Colour ScaffoldingColour ,
38
38
[ property: LocoStructOffset ( 0x9E ) ] uint8_t GeneratorFunction ,
39
39
[ property: LocoStructOffset ( 0x9F ) ] uint8_t AverageNumberOnMap ,
40
- [ property: LocoStructOffset ( 0xA0 ) , LocoArrayLength ( BuildingObject . MaxProducedQuantity ) ] uint8_t [ ] ProducedQuantity ,
40
+ [ property: LocoStructOffset ( 0xA0 ) , LocoArrayLength ( BuildingObject . MaxProducedCargoType ) ] uint8_t [ ] ProducedQuantity ,
41
41
[ property: LocoStructOffset ( 0xA2 ) , LocoStructVariableLoad , LocoArrayLength ( BuildingObject . MaxProducedCargoType ) ] List < S5Header > ProducedCargo ,
42
42
[ property: LocoStructOffset ( 0xA4 ) , LocoStructVariableLoad , LocoArrayLength ( BuildingObject . MaxRequiredCargoType ) ] List < S5Header > RequiredCargo ,
43
43
[ property: LocoStructOffset ( 0xA6 ) , LocoStructVariableLoad , LocoArrayLength ( 2 ) ] List < uint8_t > var_A6 ,
@@ -51,7 +51,6 @@ public record BuildingObject(
51
51
public const int BuildingVariationCount = 32 ;
52
52
public const int BuildingHeightCount = 4 ;
53
53
public const int BuildingAnimationCount = 2 ;
54
- public const int MaxProducedQuantity = 2 ;
55
54
public const int MaxProducedCargoType = 2 ;
56
55
public const int MaxRequiredCargoType = 2 ;
57
56
public const int MaxElevatorHeightSequences = 4 ;
@@ -84,7 +83,7 @@ public ReadOnlySpan<byte> Load(ReadOnlySpan<byte> remainingData)
84
83
;
85
84
}
86
85
87
- BuildingVariations . Add ( remainingData [ ..ptr_10 ] . ToArray ( ) ) ;
86
+ BuildingVariations . Add ( remainingData [ ..ptr_10 ] . ToArray ( ) . ToList ( ) ) ;
88
87
ptr_10 ++ ;
89
88
remainingData = remainingData [ ptr_10 ..] ;
90
89
}
@@ -133,7 +132,7 @@ public ReadOnlySpan<byte> Save()
133
132
// variation parts
134
133
foreach ( var x in BuildingVariations )
135
134
{
136
- ms . Write ( x ) ;
135
+ ms . Write ( x . ToArray ( ) ) ;
137
136
ms . WriteByte ( 0xFF ) ;
138
137
}
139
138
0 commit comments