From 4cd67b3787f9bcdeb539eb84f5fdf2cce82d6bba Mon Sep 17 00:00:00 2001 From: "Eevee (Lexy Munroe)" Date: Mon, 19 Dec 2016 16:18:53 -0800 Subject: [PATCH] Fix a misunderstand of how to use the offsets in PC files --- pokedex/extract/lib/pc.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pokedex/extract/lib/pc.py b/pokedex/extract/lib/pc.py index c1c1271..fc4a4ed 100644 --- a/pokedex/extract/lib/pc.py +++ b/pokedex/extract/lib/pc.py @@ -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('