Skip to content

Commit

Permalink
Updated 0x3092019 (#9)
Browse files Browse the repository at this point in the history
When ghost is embedded in mediatracker it doesn't haven any control entries saved
  • Loading branch information
adrien-obrecht committed May 4, 2021
1 parent 3091026 commit 982262a
Showing 1 changed file with 21 additions and 20 deletions.
41 changes: 21 additions & 20 deletions pygbx/gbx.py
Original file line number Diff line number Diff line change
Expand Up @@ -697,30 +697,31 @@ def _read_node(self, class_id, depth, bp, add=True):
bp.skip(4)

game_class.events_duration = bp.read_uint32()
bp.skip(4)
if game_class.events_duration != 0:
bp.skip(4)

num_control_names = bp.read_uint32()
game_class.control_names = []
for _ in range(num_control_names):
name = bp.read_string_lookback()
if name != '':
game_class.control_names.append(name)
num_control_names = bp.read_uint32()
game_class.control_names = []
for _ in range(num_control_names):
name = bp.read_string_lookback()
if name != '':
game_class.control_names.append(name)

if len(game_class.control_names) == 0:
continue
if len(game_class.control_names) == 0:
continue

num_control_entries = bp.read_uint32()
bp.skip(4)
for _ in range(num_control_entries):
time = bp.read_uint32() - 100000
name = game_class.control_names[bp.read_byte()]
entry = headers.ControlEntry(time, name, bp.read_uint16(), bp.read_uint16())
game_class.control_entries.append(entry)
num_control_entries = bp.read_uint32()
bp.skip(4)
for _ in range(num_control_entries):
time = bp.read_uint32() - 100000
name = game_class.control_names[bp.read_byte()]
entry = headers.ControlEntry(time, name, bp.read_uint16(), bp.read_uint16())
game_class.control_entries.append(entry)

game_class.game_version = bp.read_string()
bp.skip(3 * 4)
bp.read_string()
bp.skip(4)
game_class.game_version = bp.read_string()
bp.skip(3 * 4)
bp.read_string()
bp.skip(4)
elif cid == 0x309201c:
bp.skip(32)
elif cid == 0x03093004 or cid == 0x2403f004:
Expand Down

0 comments on commit 982262a

Please sign in to comment.