TextPointerLabelParam sometimes doesn't point to anything useful

This commit is contained in:
Bryan Bishop 2012-04-27 17:38:49 -05:00
parent 81e950c2d1
commit 90cee9191e

View File

@ -1517,6 +1517,7 @@ class RawTextPointerLabelParam(PointerLabelParam):
class TextPointerLabelParam(PointerLabelParam):
"""this is a pointer to a text script"""
bank = False
text = None
def parse(self):
PointerLabelParam.parse(self)
address = calculate_pointer_from_bytes_at(self.address, bank=self.bank)
@ -1524,8 +1525,11 @@ class TextPointerLabelParam(PointerLabelParam):
self.text = parse_text_engine_script_at(address, map_group=self.map_group, map_id=self.map_id, force=self.force, debug=self.debug)
def get_dependencies(self, recompute=False, global_dependencies=set()):
global_dependencies.add(self.text)
return [self.text]
if self.text:
global_dependencies.add(self.text)
return [self.text]
else:
return []
class MovementPointerLabelParam(PointerLabelParam):
pass