~cadence/crumpet

fb506ada85174503a8e6f3c8a633ee5c0e926557 — Cadence Ember 1 year, 2 months ago 2ee8d0e
Null check for game directory
1 files changed, 8 insertions(+), 4 deletions(-)

M crumpet.py
M crumpet.py => crumpet.py +8 -4
@@ 44,6 44,9 @@ def open_level(filename, mode):
def restricted_message():
	return "This action is restricted. You can enable this action by installing Crumpet on your own computer."

def autodetect_game_directory():
	return None # placeholder

class Crumpet:
	def _cp_dispatch(self, vpath):
		if vpath[:2] == ["api", "rtw"]:


@@ 57,10 60,11 @@ class Crumpet:
	def get_paths(self):
		# Check game directory
		game_directory = db["game_directory"]
		game_path = pathlib.Path(game_directory)
		problem = check_game_path(game_path)
		if problem:
			game_directory = autodetect_game_directory()
		if game_directory:
			game_path = pathlib.Path(game_directory)
			problem = check_game_path(game_path)
			if problem:
				game_directory = autodetect_game_directory()
		# do not need to check customlevels directory since the interface should replace whatever is sent.
		customlevels_directory = db["customlevels_directory"]
		return {