This commit is contained in:
andrea
2025-08-02 00:00:00 +02:00
parent eb3b7da07a
commit 171b9fe787

View File

@@ -125,12 +125,12 @@ class BrSimMap():
for shift in [-1, 1]: for shift in [-1, 1]:
x= coord_x + shift x= coord_x + shift
if x < 0 or x >= self.world_width -1: continue if x < 0 or x >= self.world_width -1: continue
resource= self.get_map_matrix()[x][coord_y] resource= self.get_map_matrix()[coord_y][x]
if resource and resource.is_player(): attackable_players.append(resource) if resource and resource.is_player(): attackable_players.append(resource)
for shift in [-1, 1]: for shift in [-1, 1]:
y= coord_y + shift y= coord_y + shift
if y < 0 or y >= self.world_height -1: continue if y < 0 or y >= self.world_height -1: continue
resource= self.get_map_matrix()[coord_x][y] resource= self.get_map_matrix()[y][coord_x]
if resource and resource.is_player(): attackable_players.append(resource) if resource and resource.is_player(): attackable_players.append(resource)
return attackable_players return attackable_players