From 7d1e761308654e99991ca0e7d335a6f4494fafde Mon Sep 17 00:00:00 2001 From: LoafyLemon Date: Sat, 11 Feb 2023 21:25:15 +0000 Subject: [PATCH] Bug Fix (Windows) * Replaced os.path.join with posixpath.join in some instances to enforce UNIX paths --- game/scripts/doll/bodypart.rpy | 2 +- game/scripts/doll/clothes.rpy | 2 +- game/scripts/doll/clothes_dynamic.rpy | 6 +++--- game/scripts/doll/cum.rpy | 8 ++++---- game/scripts/doll/face.rpy | 2 +- game/scripts/doll/main.rpy | 2 +- game/scripts/doll/makeup.rpy | 2 +- game/scripts/wardrobe/studio.rpy | 2 +- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/game/scripts/doll/bodypart.rpy b/game/scripts/doll/bodypart.rpy index 691dd0a0..8fcacbdb 100644 --- a/game/scripts/doll/bodypart.rpy +++ b/game/scripts/doll/bodypart.rpy @@ -20,7 +20,7 @@ init 1 python: @functools.cache def get_layers(self, hash): - path = os.path.join(self.modpath, "characters", self.name, self.char.pose, "bodyparts", self.type, self.id) + path = posixpath.join(self.modpath, "characters", self.name, self.char.pose, "bodyparts", self.type, self.id) extensions = self.extensions types = self.layer_types diff --git a/game/scripts/doll/clothes.rpy b/game/scripts/doll/clothes.rpy index 2c054ca4..661ca4a3 100644 --- a/game/scripts/doll/clothes.rpy +++ b/game/scripts/doll/clothes.rpy @@ -58,7 +58,7 @@ init python: @functools.cache def get_layers(self, hash): - path = os.path.join(self.modpath, "characters", self.name, self.char.pose, "clothes", self.type, self.id) + path = posixpath.join(self.modpath, "characters", self.name, self.char.pose, "clothes", self.type, self.id) extensions = self.extensions types = self.layer_types diff --git a/game/scripts/doll/clothes_dynamic.rpy b/game/scripts/doll/clothes_dynamic.rpy index e163c2bf..8c7d9536 100644 --- a/game/scripts/doll/clothes_dynamic.rpy +++ b/game/scripts/doll/clothes_dynamic.rpy @@ -34,7 +34,7 @@ init python: @functools.cache def get_layers(self, hash, _ignore_equipped=False): - path = os.path.join(self.modpath, "characters", self.name, self.char.pose, "clothes", self.type, self.id) + path = posixpath.join(self.modpath, "characters", self.name, self.char.pose, "clothes", self.type, self.id) _tracking = self._tracking def _negative_lookahead(): @@ -43,7 +43,7 @@ init python: def _lookahead(path): tracking_object = self.tracking_object tracking_id = tracking_object.id if tracking_object else None - path = os.path.join(path, tracking_id) + path = posixpath.join(path, tracking_id) if not any(fp.startswith(path) for fp in renpy.list_files()): return "default" @@ -102,7 +102,7 @@ init python: print(f"Invalid tracker for object: {self}") return {} - path = os.path.join(path, tracking_id) + path = posixpath.join(path, tracking_id) extensions = self.extensions types = self.layer_types diff --git a/game/scripts/doll/cum.rpy b/game/scripts/doll/cum.rpy index d946bc57..4e6b5eb2 100644 --- a/game/scripts/doll/cum.rpy +++ b/game/scripts/doll/cum.rpy @@ -53,14 +53,14 @@ init python: if part in face_layers: zorder = face_layers.get(part) identifier = active_faces.get(part, "default") - path = os.path.join(self.char.modpath, "characters", self.char.name, self.char.pose, "cum", part, name, identifier) + path = posixpath.join(self.char.modpath, "characters", self.char.name, self.char.pose, "cum", part, name, identifier) else: cloth, zorder, is_worn = active_clothes.get(part, [None, None, None]) if is_worn is None: # Backwards compatibility for old layering system - path = os.path.join("characters", self.char.name, self.char.pose, "cum", part, name) + path = posixpath.join("characters", self.char.name, self.char.pose, "cum", part, name) if config.developer: renpy.notify(f"Using old-type cum layer, consider updating the code; Layer: \"{part}\"") @@ -74,8 +74,8 @@ init python: modpath = cloth.modpath zorder = cloth.zorder + 1 - path = os.path.join(modpath, "characters", self.char.name, self.char.pose, "cum", part, name, identifier) - path = path if _lookahead(path) else os.path.join(os.path.split(path)[0], (identifier := "default")) + path = posixpath.join(modpath, "characters", self.char.name, self.char.pose, "cum", part, name, identifier) + path = path if _lookahead(path) else posixpath.join(os.path.split(path)[0], (identifier := "default")) for f in renpy.list_files(): fp, fn = os.path.split(f) diff --git a/game/scripts/doll/face.rpy b/game/scripts/doll/face.rpy index 0aeeccfd..e41d622f 100644 --- a/game/scripts/doll/face.rpy +++ b/game/scripts/doll/face.rpy @@ -41,7 +41,7 @@ init python: if name is None: continue - path = os.path.join(self.char.modpath, "characters", self.char.name, self.char.pose, "face", part, name) + path = posixpath.join(self.char.modpath, "characters", self.char.name, self.char.pose, "face", part, name) for f in renpy.list_files(): fp, fn = os.path.split(f) diff --git a/game/scripts/doll/main.rpy b/game/scripts/doll/main.rpy index 870b7da6..23c922b6 100644 --- a/game/scripts/doll/main.rpy +++ b/game/scripts/doll/main.rpy @@ -467,7 +467,7 @@ init python: self.show() def set_pose(self, pose): - pose = "" if pose is None else os.path.join("poses", pose) + pose = "" if pose is None else posixpath.join("poses", pose) self.pose = pose self.body.is_stale() self.face.is_stale() diff --git a/game/scripts/doll/makeup.rpy b/game/scripts/doll/makeup.rpy index a5df20ca..201a3f0c 100644 --- a/game/scripts/doll/makeup.rpy +++ b/game/scripts/doll/makeup.rpy @@ -20,7 +20,7 @@ init python: print(f"Invalid tracker for object: {self}") return [] - path = os.path.join(self.modpath, "characters", self.name, self.char.pose, "clothes", self.type, self.id, tracking) + path = posixpath.join(self.modpath, "characters", self.name, self.char.pose, "clothes", self.type, self.id, tracking) extensions = self.extensions types = self.layer_types diff --git a/game/scripts/wardrobe/studio.rpy b/game/scripts/wardrobe/studio.rpy index 282811b1..a4083fde 100644 --- a/game/scripts/wardrobe/studio.rpy +++ b/game/scripts/wardrobe/studio.rpy @@ -24,7 +24,7 @@ init python in studio: for part in charobj.face._face.keys(): - path = os.path.join("characters", charname, charobj.pose, "face", part) + path = posixpath.join("characters", charname, charobj.pose, "face", part) for f in renpy.list_files(): fp, fn = os.path.split(f)