Skip to content

Commit

Permalink
rename function to match override and only run the override code once
Browse files Browse the repository at this point in the history
  • Loading branch information
ThePotatoGuy committed Feb 25, 2024
1 parent 4a51dc6 commit a04fc92
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions Monika After Story/game/overrides.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ python early in mas_overrides:
savelocation.init = savelocation_init_override


def parser_report_parser_errors_override():
def parser_report_parse_errors_override():
"""
This override is actually for something unrelated.
Expand All @@ -80,14 +80,18 @@ python early in mas_overrides:
so this is the last place we can remove the scripts rpa stuff we dont
want.
"""
for index, initcode in reversed(list(enumerate(renpy.game.script.initcode))):
init_lvl, obj = initcode
global report_parse_errors_ran

try:
if obj.filename == "script-poemgame.rpyc":
renpy.game.script.initcode.pop(index)
except:
pass
if not report_parse_errors_ran:
for index, initcode in reversed(list(enumerate(renpy.game.script.initcode))):
init_lvl, obj = initcode

try:
if obj.filename == "script-poemgame.rpyc":
renpy.game.script.initcode.pop(index)
except:
pass
report_parse_errors_ran = True

# non-override code below

Expand Down Expand Up @@ -137,6 +141,7 @@ python early in mas_overrides:

return True

parser.report_parse_errors = parser_report_parser_errors_override
report_parse_errors_ran = False
parser.report_parse_errors = parser_report_parse_errors_override


0 comments on commit a04fc92

Please sign in to comment.