From a27a7f2892e5b24f4446d46c892b7d38ff3f6970 Mon Sep 17 00:00:00 2001 From: Bryan Bishop Date: Sun, 20 May 2012 09:37:43 -0500 Subject: reuse pre-existing/pre-inserted MapBlockData objects when possible --- extras/crystal.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'extras/crystal.py') diff --git a/extras/crystal.py b/extras/crystal.py index a55c50a4a..4ae1f0ec6 100644 --- a/extras/crystal.py +++ b/extras/crystal.py @@ -4743,14 +4743,16 @@ class SecondMapHeader: self.height = DecimalParam(address=address+1) self.width = DecimalParam(address=address+2) - #TODO: process blockdata ? #bank appears first ###self.blockdata_address = PointerLabelBeforeBank(address+3) self.blockdata_address = calculate_pointer_from_bytes_at(address+3, bank=True) - self.blockdata = MapBlockData(self.blockdata_address, map_group=self.map_group, map_id=self.map_id, debug=self.debug, width=self.width, height=self.height) + xyz = script_parse_table[self.blockdata_address] + if xyz == None: + self.blockdata = MapBlockData(self.blockdata_address, map_group=self.map_group, map_id=self.map_id, debug=self.debug, width=self.width, height=self.height) + else: + self.blockdata = xyz #bank appears first - #TODO: process MapScriptHeader ###self.script_address = PointerLabelBeforeBank(address+6) self.script_header_address = calculate_pointer_from_bytes_at(address+6, bank=True) self.script_header = MapScriptHeader(self.script_header_address, map_group=self.map_group, map_id=self.map_id, debug=self.debug) -- cgit v1.2.3