mirror of
https://github.com/Jylpah/blitz-tools.git
synced 2026-10-21 10:17:05 +02:00
Fixing a bug related to reading map data form maps.json
This commit is contained in:
1 parent
05bc831355
commit
f8776de503
1 file changed
+8
-2
+8
-2
@@ -269,7 +269,7 @@ class WG:
|
||||
|
||||
self.WG_appID = WG_appID
|
||||
self.tanks = None
|
||||
|
||||
|
||||
if (tankopedia_fn != None):
|
||||
if os.path.exists(tankopedia_fn) and os.path.isfile(tankopedia_fn):
|
||||
try:
|
||||
@@ -283,7 +283,7 @@ class WG:
|
||||
if os.path.exists(maps_fn) and os.path.isfile(maps_fn):
|
||||
try:
|
||||
with open(maps_fn, 'rt', encoding='utf8') as f:
|
||||
self.maps = json.loads(f.read())
|
||||
WG.maps = json.loads(f.read())
|
||||
except Exception as err:
|
||||
error('Could not read maps file: ' + maps_fn + '\n' + str(err))
|
||||
else:
|
||||
@@ -337,6 +337,12 @@ class WG:
|
||||
return 'eu'
|
||||
return None
|
||||
|
||||
@classmethod
|
||||
def updateMaps(cls, mapdata: dict):
|
||||
"""Update maps data"""
|
||||
cls.maps = mapdata
|
||||
return None
|
||||
|
||||
@classmethod
|
||||
def getMap(cls, mapStr: str) -> str:
|
||||
"""Return map name from short map string in replays"""
|
||||
|
||||
Reference in new issue
Block a user