Skip to content

Commit 70a1ee6

Browse files
Fix bug in map size
1 parent a9355c0 commit 70a1ee6

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

maps/map1.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"width":9,
3-
"height":11,
2+
"width":11,
3+
"height":9,
44
"player1_coordinate":[0,0],
55
"player2_coordinate":[0,8],
66
"player3_coordinate":[0,2],

src/environment/env.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ def __init__(self,
8484
'wallet': 0
8585
}]
8686
self.input_map = input_map
87-
self.x_size = input_map['width']
88-
self.y_size = input_map['height']
87+
self.x_size = input_map['height']
88+
self.y_size = input_map['width']
8989
self.agents_cnt = agents_cnt
9090
self.rounds = rounds
9191
self.max_rounds = rounds
@@ -369,8 +369,8 @@ def generate_info(self):
369369

370370
def load_map(self):
371371
conf_dic = self.input_map
372-
self.x_size = conf_dic["width"]
373-
self.y_size = conf_dic["height"]
372+
self.x_size = conf_dic["height"]
373+
self.y_size = conf_dic["width"]
374374
self.fog_map = conf_dic["fog_map"]
375375
for i in range(self.agents_cnt):
376376
self.agents_list[i].x = conf_dic[f"player{i+1}_coordinate"][0]

src/process/GameHandler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ def final_update_info(self):
155155
igd['winner'] = self.players[self.winner[0] - 1]['name']
156156
igd['winnerId'] = self.winner[0]
157157
igd['win_reason'] = self.winner[1]
158-
igd['map_width'] = int(self.info[0]['board'].shape[0])
159-
igd['map_height'] = int(self.info[0]['board'].shape[1])
158+
igd['map_width'] = self.map['width']
159+
igd['map_height'] = self.map['height']
160160
igd['map_data'] = {}
161161
igd['map_data']['obstacle'] = self.map['walls']
162162
igd['map_data']['fog'] = self.map['fog_map']

0 commit comments

Comments
 (0)