summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2022-07-28 10:26:36 -0300
committerJesusaves <cpntb1@ymail.com>2022-07-28 10:26:36 -0300
commit39ad62c23d917507c4a8912b071730abd2210a61 (patch)
tree88b924c16e3757335476cc536e99ce288c183c27
parenta0d4981e4f5e1cc03506324a602cf4468b6eee90 (diff)
downloadclient-39ad62c23d917507c4a8912b071730abd2210a61.tar.gz
client-39ad62c23d917507c4a8912b071730abd2210a61.tar.bz2
client-39ad62c23d917507c4a8912b071730abd2210a61.tar.xz
client-39ad62c23d917507c4a8912b071730abd2210a61.zip
Fix a Python3 bug on dl_search
-rw-r--r--game/01_init.rpy1
-rw-r--r--game/02_init.rpy5
-rw-r--r--game/03_init.rpy2
3 files changed, 5 insertions, 3 deletions
diff --git a/game/01_init.rpy b/game/01_init.rpy
index 0b6eb48..4b7c596 100644
--- a/game/01_init.rpy
+++ b/game/01_init.rpy
@@ -30,7 +30,6 @@ init -3 python:
# Ren'Py should come with Python 2.7.10 (2710), but just in case
# After all, I only tested with 2.7.10, 2.7.13 and 2.7.15
- print(PYTHON_VERSION)
if (PYTHON_VERSION < 2700):
raise Exception("WARNING: Python version is too old\nStrange bugs may happen on your client.\n\nClick on \"Ignore\" to continue.\nClick on \"Quit\" to exit.")
# From Python 3.6.x up to Python 3.9.x supported
diff --git a/game/02_init.rpy b/game/02_init.rpy
index 9ee3749..7a5076a 100644
--- a/game/02_init.rpy
+++ b/game/02_init.rpy
@@ -26,7 +26,10 @@ init -1 python:
# Returns the dictionary, or returns ERR_INVALID
def dl_search(array, key, search):
try:
- r=(item for item in array if item[key] == search).next()
+ if (PYTHON_VERSION < 3000):
+ r=(item for item in array if item[key] == search).next()
+ else:
+ r=next(item for item in array if item[key] == search)
except:
r=ERR_INVALID
if r is None:
diff --git a/game/03_init.rpy b/game/03_init.rpy
index b6e4e8d..8b31059 100644
--- a/game/03_init.rpy
+++ b/game/03_init.rpy
@@ -144,7 +144,7 @@ init python:
print("ERROR: Not a regular display name")
return name
- # Loads a sound called VAL (FIXME)
+ # Loads a sound called VAL
def get_sfx(val, ext=".mp3"):
# Search for the sound
show_img(val, False, ext=ext)