aboutsummaryrefslogtreecommitdiff
path: root/diplomacy/utils
diff options
context:
space:
mode:
Diffstat (limited to 'diplomacy/utils')
-rw-r--r--diplomacy/utils/convoy_paths.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/diplomacy/utils/convoy_paths.py b/diplomacy/utils/convoy_paths.py
index 5929d51..27b6836 100644
--- a/diplomacy/utils/convoy_paths.py
+++ b/diplomacy/utils/convoy_paths.py
@@ -188,7 +188,10 @@ def add_to_cache(map_name):
pass
# Getting map MD5 hash
- map_path = os.path.join(settings.PACKAGE_DIR, 'maps', map_name + '.map')
+ if os.path.exists(map_name):
+ map_path = map_name
+ else:
+ map_path = os.path.join(settings.PACKAGE_DIR, 'maps', map_name + '.map')
if not os.path.exists(map_path):
return None
map_hash = get_file_md5(map_path)
@@ -227,6 +230,7 @@ def get_convoy_paths_cache():
map_hash = get_file_md5(file_path)
if map_hash in disk_convoy_paths:
cache_convoy_paths[map_name] = disk_convoy_paths[map_hash]
+ cache_convoy_paths[file_path] = disk_convoy_paths[map_hash]
# Returning
return cache_convoy_paths