From e23ebf59ce54f9682e86993f2775f372672f8fdf Mon Sep 17 00:00:00 2001 From: LoafyLemon Date: Wed, 15 Jun 2022 22:34:03 +0100 Subject: [PATCH] Studio fix * Fix a crash affecting developer build --- game/scripts/doll/face.rpy | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/game/scripts/doll/face.rpy b/game/scripts/doll/face.rpy index 60d9e507..194e3219 100644 --- a/game/scripts/doll/face.rpy +++ b/game/scripts/doll/face.rpy @@ -1,7 +1,7 @@ init python: class DollFace(DollMethods): - blacklist_blink = {"closed", "happyCl", "wink"} + blacklist_blink = {None, "closed", "happyCl", "wink"} def __init__(self, obj, face): self.char = obj @@ -19,29 +19,32 @@ init python: sprites.append(("{}{}/{}.webp".format(self.imagepath, k, v[0]), v[1])) eyes = self.face["eyes"][0] + pupils = self.face["pupils"][0] if eyes not in self.blacklist_blink: blink_path = "{}eyes/closed.webp".format(self.imagepath) eyes_path = "{}eyes/{}.webp".format(self.imagepath, eyes) mask_path = "{}eyes/{}_mask.webp".format(self.imagepath, eyes) - pupils_path = "{}pupils/{}.webp".format(self.imagepath, self.face["pupils"][0]) + pupils_path = "{}pupils/{}.webp".format(self.imagepath, pupils) - if renpy.loadable(blink_path): - normal = Fixed(eyes_path, AlphaMask(pupils_path, mask_path)) - sprites.append( (doll_blink(normal, blink_path), self.face["eyes"][1]) ) - else: + if pupils: + if renpy.loadable(blink_path): + normal = Fixed(eyes_path, AlphaMask(pupils_path, mask_path)) + sprites.append( (doll_blink(normal, blink_path), self.face["eyes"][1]) ) + else: + sprites.append((eyes_path, self.face["eyes"][1])) + + if renpy.loadable(mask_path): + sprites.append((AlphaMask(pupils_path, mask_path), self.face["pupils"][1])) + else: + if eyes: + eyes_path = "{}eyes/{}.webp".format(self.imagepath, eyes) sprites.append((eyes_path, self.face["eyes"][1])) + mask_path = "{}eyes/{}_mask.webp".format(self.imagepath, eyes) if renpy.loadable(mask_path): + pupils_path = "{}pupils/{}.webp".format(self.imagepath, pupils) sprites.append((AlphaMask(pupils_path, mask_path), self.face["pupils"][1])) - else: - eyes_path = "{}eyes/{}.webp".format(self.imagepath, eyes) - sprites.append((eyes_path, self.face["eyes"][1])) - - mask_path = "{}eyes/{}_mask.webp".format(self.imagepath, eyes) - if renpy.loadable(mask_path): - pupils_path = "{}pupils/{}.webp".format(self.imagepath, self.face["pupils"][0]) - sprites.append((AlphaMask(pupils_path, mask_path), self.face["pupils"][1])) sprites.sort(key=itemgetter(1)) sprites = tuple(x[0] for x in sprites)