Fix invalid tile coordinates in GameMap.setTile() method

This commit is contained in:
2021-02-01 12:49:07 +01:00
parent b6439e010a
commit 44e875299a

View File

@@ -39,9 +39,9 @@ public class GameMap {
Arrays.fill(passageMap, 0, rows * cols, PassageAbility.ALLOW); Arrays.fill(passageMap, 0, rows * cols, PassageAbility.ALLOW);
} }
public void setTile(int layer, int row, int col, Tile tile) { public void setTile(int layer, int row, int col, Tile tile) {
recalculateTileGeometry(tile, row, col); recalculateTileGeometry(tile, col, row);
map[layer][row * cols + col] = tile; map[layer][col * cols + row] = tile;
} }
private void recalculateTileGeometry(Tile tile, int i, int j) { private void recalculateTileGeometry(Tile tile, int i, int j) {