mirror of
https://github.com/Jylpah/blitz-tools.git
synced 2026-10-23 19:19:53 +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.WG_appID = WG_appID
|
||||||
self.tanks = None
|
self.tanks = None
|
||||||
|
|
||||||
if (tankopedia_fn != None):
|
if (tankopedia_fn != None):
|
||||||
if os.path.exists(tankopedia_fn) and os.path.isfile(tankopedia_fn):
|
if os.path.exists(tankopedia_fn) and os.path.isfile(tankopedia_fn):
|
||||||
try:
|
try:
|
||||||
@@ -283,7 +283,7 @@ class WG:
|
|||||||
if os.path.exists(maps_fn) and os.path.isfile(maps_fn):
|
if os.path.exists(maps_fn) and os.path.isfile(maps_fn):
|
||||||
try:
|
try:
|
||||||
with open(maps_fn, 'rt', encoding='utf8') as f:
|
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:
|
except Exception as err:
|
||||||
error('Could not read maps file: ' + maps_fn + '\n' + str(err))
|
error('Could not read maps file: ' + maps_fn + '\n' + str(err))
|
||||||
else:
|
else:
|
||||||
@@ -337,6 +337,12 @@ class WG:
|
|||||||
return 'eu'
|
return 'eu'
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def updateMaps(cls, mapdata: dict):
|
||||||
|
"""Update maps data"""
|
||||||
|
cls.maps = mapdata
|
||||||
|
return None
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def getMap(cls, mapStr: str) -> str:
|
def getMap(cls, mapStr: str) -> str:
|
||||||
"""Return map name from short map string in replays"""
|
"""Return map name from short map string in replays"""
|
||||||
|
|||||||
Reference in new issue
Block a user