Merge pull request #3737 from Russell-Jones/patch-1

--gamedir doesn't work as GAMEDIR gets overwritten
This commit is contained in:
Griatch 2025-03-08 21:16:11 +01:00 committed by GitHub
commit b8ec33254d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1787,8 +1787,11 @@ def init_game_directory(path, check_db=True, need_gamedir=True):
be run in a valid game directory.
"""
# set the GAMEDIR path
if need_gamedir:
global GAMEDIR
# Set the GAMEDIR path if not set already
## Declaring it global doesn't set the variable
## This check is needed for evennia --gamedir to work
if need_gamedir and 'GAMEDIR' not in globals():
set_gamedir(path)
# Add gamedir to python path