From 39ad62c23d917507c4a8912b071730abd2210a61 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Thu, 28 Jul 2022 10:26:36 -0300 Subject: Fix a Python3 bug on dl_search --- game/01_init.rpy | 1 - game/02_init.rpy | 5 ++++- game/03_init.rpy | 2 +- 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) -- cgit v1.2.3-60-g2f50