mirror of https://github.com/pret/pokecrystal.git
continue to fix off-by-one error in TextScript
This commit is contained in:
parent
806687bf69
commit
8cc5597b0b
|
@ -529,9 +529,9 @@ class TextScript:
|
||||||
#whichever command comes first
|
#whichever command comes first
|
||||||
jump = min([jump57, jump50, jump58])
|
jump = min([jump57, jump50, jump58])
|
||||||
|
|
||||||
end_address = offset + jump - 1 #we want the address before $57
|
end_address = offset + jump #we want the address before $57
|
||||||
|
|
||||||
lines = process_00_subcommands(offset+1, end_address+1, debug=debug)
|
lines = process_00_subcommands(offset+1, end_address, debug=debug)
|
||||||
|
|
||||||
if show and debug:
|
if show and debug:
|
||||||
text = parse_text_at2(offset+1, end_address-offset+1, debug=debug)
|
text = parse_text_at2(offset+1, end_address-offset+1, debug=debug)
|
||||||
|
@ -648,9 +648,9 @@ class TextScript:
|
||||||
#whichever command comes first
|
#whichever command comes first
|
||||||
jump = min([jump57, jump50, jump58])
|
jump = min([jump57, jump50, jump58])
|
||||||
|
|
||||||
end_address = offset + jump - 1 #we want the address before $57
|
end_address = offset + jump #we want the address before $57
|
||||||
|
|
||||||
lines = process_00_subcommands(offset+1, end_address+1, debug=debug)
|
lines = process_00_subcommands(offset+1, end_address, debug=debug)
|
||||||
|
|
||||||
if show and debug:
|
if show and debug:
|
||||||
text = parse_text_at2(offset+1, end_address-offset+1, debug=debug)
|
text = parse_text_at2(offset+1, end_address-offset+1, debug=debug)
|
||||||
|
@ -709,8 +709,8 @@ class TextScript:
|
||||||
# sys.exit()
|
# sys.exit()
|
||||||
|
|
||||||
self.commands = commands
|
self.commands = commands
|
||||||
self.last_address = offset - 1 #why -1??
|
self.last_address = offset
|
||||||
script_parse_table[original_address:offset-1] = self
|
script_parse_table[original_address:offset] = self
|
||||||
self.size = self.byte_count = self.last_address - original_address
|
self.size = self.byte_count = self.last_address - original_address
|
||||||
return commands
|
return commands
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue