aboutsummaryrefslogtreecommitdiff
path: root/parse-brlyt.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--parse-brlyt.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/parse-brlyt.py b/parse-brlyt.py
index ea998ca..9ba2cd4 100644
--- a/parse-brlyt.py
+++ b/parse-brlyt.py
@@ -48,6 +48,7 @@ for typ, chunk in ch:
vars, pos = parse_data(chunk, 'numoffs')
vars[things] = []
pos += vars['offs']
+ bpos = pos
del vars['offs'] # unneeded
for n in xrange(vars['num']):
if typ == 'mat1':
@@ -57,7 +58,7 @@ for typ, chunk in ch:
offset, unk = struct.unpack('>II', chunk[pos:pos+8])
pos += 8
- name = nullterm(chunk[offset - 8:])
+ name = nullterm(chunk[(-8 if typ == 'mat1' else bpos) + offset:])
vars[things].append(name if typ == 'mat1' else {'name': name, 'unk': unk})
if typ == 'mat1':
materials = vars['materials']