From 62b9d97a313a259ada1e97bfc0512dbc05d339aa Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Wed, 12 Sep 2018 17:44:40 -0500 Subject: [PATCH] Smart path now draws a 2x2 region, instead of 3x3 region --- editor.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/editor.cpp b/editor.cpp index 13790463..9a07e9b7 100755 --- a/editor.cpp +++ b/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.