diff --git a/src/mainwindow_scriptapi.cpp b/src/mainwindow_scriptapi.cpp index 43d0bfc1..6fa61340 100644 --- a/src/mainwindow_scriptapi.cpp +++ b/src/mainwindow_scriptapi.cpp @@ -149,7 +149,7 @@ void MainWindow::magicFillFromSelection(int x, int y, bool forceRedraw, bool com void MainWindow::shift(int xDelta, int yDelta, bool forceRedraw, bool commitChanges) { if (!this->editor || !this->editor->map) return; - this->editor->map_item->shift(xDelta, yDelta); + this->editor->map_item->shift(xDelta, yDelta, true); this->tryCommitMapChanges(commitChanges); this->tryRedrawMapArea(forceRedraw); } diff --git a/src/ui/mappixmapitem.cpp b/src/ui/mappixmapitem.cpp index 35aa9e10..e7f82bb0 100644 --- a/src/ui/mappixmapitem.cpp +++ b/src/ui/mappixmapitem.cpp @@ -76,7 +76,7 @@ void MapPixmapItem::shift(QGraphicsSceneMouseEvent *event) { } void MapPixmapItem::shift(int xDelta, int yDelta, bool fromScriptCall) { - Blockdata oldMetatiles = !fromScriptCall ? map->layout->blockdata : Blockdata(); + Blockdata oldMetatiles = map->layout->blockdata; for (int i = 0; i < map->getWidth(); i++) for (int j = 0; j < map->getHeight(); j++) {