--gamedir doesn't work as GAMEDIR gets overwritten

Whether altgamedir from argparse has set GAMEDIR or not, the GAMEDIR is set based on the present working directory. This stops evennia --gamedir /some/path/not/the/pwd from having any effect (tested in podman with docker.io/evennia/evennia:latest
This commit is contained in:
Russell-Jones 2025-03-08 17:47:44 +00:00 committed by GitHub
parent 6117e85ac9
commit 5de3299731
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