mirror of
https://github.com/veekun/pokedex.git
synced 2024-08-20 18:16:34 +00:00
Fix a misunderstand of how to use the offsets in PC files
This commit is contained in:
parent
b8a5f634d5
commit
4cd67b3787
1 changed files with 5 additions and 2 deletions
|
@ -13,7 +13,10 @@ class PokemonContainerFile(_ContainerFile):
|
|||
magic, entry_ct = stream.unpack('<2sH')
|
||||
assert magic == b'PC'
|
||||
|
||||
# Offsets are "A B C ...", where entry 0 ranges from A to B, entry 1
|
||||
# from B to C, etc.
|
||||
offsets = stream.unpack('<{}L'.format(entry_ct + 1))
|
||||
self.slices = []
|
||||
for _ in range(entry_ct):
|
||||
start, end = stream.unpack('<LL')
|
||||
for i in range(entry_ct):
|
||||
start, end = offsets[i:i + 2]
|
||||
self.slices.append(self.stream.slice(start, end - start))
|
||||
|
|
Loading…
Reference in a new issue