Package: renpy / 7.3.5+dfsg-1

01_abspath.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
From: Debian Games Team <pkg-games-devel@lists.alioth.debian.org>
Date: Tue, 12 Jan 2016 18:15:44 +0100
Subject: _abspath

---
 renpy.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/renpy.py b/renpy.py
index f887051..c67d51e 100755
--- a/renpy.py
+++ b/renpy.py
@@ -80,6 +80,13 @@ def path_to_saves(gamedir, save_directory=None):
 
         return rv
 
+    if gamedir.startswith("/usr/share/games/renpy"):
+        # The gamename is the final component of the path to the gamedir
+        gamename = gamedir[len("/usr/share/games/renpy"):]
+        if gamename.endswith("/game") or gamename.endswith("/data"):
+            gamename = gamename[:-5]
+        return os.path.expanduser("~/.renpy/") + gamename + "/saves"
+
     if renpy.ios:
         from pyobjus import autoclass
         from pyobjus.objc_py_types import enum
@@ -140,7 +147,7 @@ def path_to_saves(gamedir, save_directory=None):
 # Returns the path to the Ren'Py base directory (containing common and
 # the launcher, usually.)
 def path_to_renpy_base():
-    renpy_base = os.path.dirname(os.path.realpath(sys.argv[0]))
+    renpy_base = "/usr/share/games/renpy"
     renpy_base = os.path.abspath(renpy_base)
 
     return renpy_base