Skip to content

Commit

Permalink
Improve behavior WRT retain-after-load.
Browse files Browse the repository at this point in the history
  • Loading branch information
renpytom committed Mar 29, 2018
1 parent 458de8b commit 8eb3c85
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions renpy/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -1362,7 +1362,19 @@ def begin(self, force=False):

# We only begin a checkpoint if the previous statement reached a checkpoint,
# or an interaction took place. (Or we're forced.)
if (not force) and (self.current and not self.current.checkpoint) and (not self.did_interaction):
ignore = True

if force:
ignore = False
elif self.did_interaction:
ignore = False
elif self.current is not None:
if self.current.checkpoint:
ignore = False
elif self.current.retain_after_load:
ignore = False

if ignore:
return

self.did_interaction = False
Expand Down Expand Up @@ -1556,7 +1568,7 @@ def checkpoint(self, data=None, keep_rollback=False, hard=True):
if (self.current.context.current == fwd_name
and data == fwd_data
and (keep_rollback or self.rolled_forward)
):
):
self.forward.pop(0)
else:
self.forward = [ ]
Expand Down Expand Up @@ -1586,8 +1598,12 @@ def retain_after_load(self):
when the game is loaded.
"""

if renpy.display.predict.predicting:
return

self.retain_after_load_flag = True
self.current.retain_after_load = True
renpy.game.context().force_checkpoint = True

def fix_rollback(self):
if not self.rollback_is_fixed and len(self.log) > 1:
Expand Down

0 comments on commit 8eb3c85

Please sign in to comment.