mirror of
https://github.com/pret/pokemon-reverse-engineering-tools.git
synced 2026-08-09 10:47:24 -05:00
make up TextScriptException to replace two asserts
This commit is contained in:
parent
ccc1d82d95
commit
e188fa3eb4
|
|
@ -372,8 +372,15 @@ class TextScript:
|
|||
logging.debug("cls.last_address is {0}".format(hex(cls.last_address)))
|
||||
logging.debug("self.last_address is {0}".format(hex(self.last_address)))
|
||||
|
||||
assert self.last_address == (cls.address + cls.size), "the last address should equal the last command's (address + size)"
|
||||
assert self.last_address == cls.last_address, "the last address of the TextScript should be the last_address of its last command"
|
||||
if self.last_address != (cls.address + cls.size):
|
||||
raise exceptions.TextScriptException(
|
||||
"the last address should equal the last command's (address + size)"
|
||||
)
|
||||
|
||||
if self.last_address != cls.last_address:
|
||||
raise exceptions.TextScriptException(
|
||||
"the last address of the TextScript should be the last_address of its last command"
|
||||
)
|
||||
|
||||
# just some debugging..
|
||||
if self.debug:
|
||||
|
|
|
|||
|
|
@ -6,3 +6,8 @@ class AddressException(Exception):
|
|||
"""
|
||||
There was a problem with an address. Maybe it was out of range or invalid.
|
||||
"""
|
||||
|
||||
class TextScriptException(Exception):
|
||||
"""
|
||||
TextScript encountered an inconsistency or problem.
|
||||
"""
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user