Skip to content

Commit 749aa73

Browse files
PeterNglx22
authored andcommitted
Change: Write extended bytes in Action 3 if ID is >= 0xFF.
1 parent 17deb67 commit 749aa73

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

nml/actions/action3.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,13 @@ def map_cid(cid):
7474

7575
def write(self, file):
7676
size = 7 + 3 * len(self.cid_mappings)
77-
if self.feature <= 3:
78-
size += 2 # Vehicles use extended byte
77+
if self.feature <= 3 or self.id >= 0xFF:
78+
size += 2 # Vehicles or IDs >= 255 use extended byte
7979
file.start_sprite(size)
8080
file.print_bytex(3)
8181
file.print_bytex(self.feature)
8282
file.print_bytex(1 if not self.is_livery_override else 0x81) # a single id
83-
file.print_varx(self.id, 3 if self.feature <= 3 else 1)
83+
file.print_varx(self.id, 3 if self.feature <= 3 or self.id >= 0xFF else 1)
8484
file.print_byte(len(self.cid_mappings))
8585
file.newline()
8686
for cargo, cid, comment in self.cid_mappings:

0 commit comments

Comments
 (0)