From 5a0f55cc08fb2ad9c69da62b7ae7c66ec0ee6dc4 Mon Sep 17 00:00:00 2001 From: LoafyLemon Date: Tue, 18 Jul 2023 16:17:35 +0100 Subject: [PATCH] Bug fix * Fixed stale images being displayed when threading is enabled and no image was called in a while --- game/scripts/doll/main.rpy | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/game/scripts/doll/main.rpy b/game/scripts/doll/main.rpy index 450eedfc..5a942049 100644 --- a/game/scripts/doll/main.rpy +++ b/game/scripts/doll/main.rpy @@ -155,25 +155,25 @@ init python: def _image(self, st, at): return self._sprite.get_with_default(Null()), None + def is_stale(self): + curr_hash = self.generate_hash() + stale = curr_hash != self._hash + self._hash = curr_hash + + if stale and settings.get("multithreading"): + self.build_image() + return stale + @property def image(self): + if not renpy.is_skipping() and self.is_stale(): + + if renpy.showing(get_character_tag(self.name), layer=self.layer): + self.show() + if settings.get("multithreading"): - - if not renpy.is_skipping() and self.is_stale(): - self.build_image() - - if renpy.showing(get_character_tag(self.name), layer=self.layer): - self.show() - # elif renpy.in_rollback(): - # self.build_image() - return DynamicDisplayable(self._image) else: - if not renpy.is_skipping() and self.is_stale(): - - if renpy.showing(get_character_tag(self.name), layer=self.layer): - self.show() - return self._build_image(self._hash) def equip(self, obj, remove_old=True):