Smart path now draws a 2x2 region, instead of 3x3 region
This commit is contained in:
parent
2a00e8aee9
commit
62b9d97a31
1 changed files with 6 additions and 6 deletions
12
editor.cpp
12
editor.cpp
|
@ -1145,8 +1145,8 @@ void MapPixmapItem::paintSmartPath(int x, int y) {
|
|||
int openTile = map->selected_metatiles->at(4);
|
||||
|
||||
// Fill the region with the open tile.
|
||||
for (int i = -1; i <= 1; i++)
|
||||
for (int j = -1; j <= 1; j++) {
|
||||
for (int i = 0; i <= 1; i++)
|
||||
for (int j = 0; j <= 1; j++) {
|
||||
// Check if in map bounds.
|
||||
if (!(i + x < map->getWidth() && i + x >= 0 && j + y < map->getHeight() && j + y >= 0))
|
||||
continue;
|
||||
|
@ -1160,14 +1160,14 @@ void MapPixmapItem::paintSmartPath(int x, int y) {
|
|||
}
|
||||
|
||||
// Go back and resolve the edge tiles
|
||||
for (int i = -2; i <= 2; i++)
|
||||
for (int j = -2; j <= 2; j++) {
|
||||
for (int i = -1; i <= 2; i++)
|
||||
for (int j = -1; j <= 2; j++) {
|
||||
// Check if in map bounds.
|
||||
if (!(i + x < map->getWidth() && i + x >= 0 && j + y < map->getHeight() && j + y >= 0))
|
||||
continue;
|
||||
// Ignore the corners, which can't possible be affected by the smart path.
|
||||
if ((i == -2 && j == -2) || (i == 2 && j == -2) ||
|
||||
(i == -2 && j == 2) || (i == 2 && j == 2))
|
||||
if ((i == -1 && j == -1) || (i == 2 && j == -1) ||
|
||||
(i == -1 && j == 2) || (i == 2 && j == 2))
|
||||
continue;
|
||||
|
||||
// Ignore tiles that aren't part of the smart path set.
|
||||
|
|
Loading…
Reference in a new issue