diff --git a/include/core/editcommands.h b/include/core/editcommands.h index 3743c69d..032f3dc9 100644 --- a/include/core/editcommands.h +++ b/include/core/editcommands.h @@ -345,7 +345,7 @@ public: void undo() override; void redo() override; - bool mergeWith(const QUndoCommand *) override { return false; }; + bool mergeWith(const QUndoCommand *) override { return false; } int id() const override { return CommandId::ID_ScriptEditMap; } private: diff --git a/src/core/editcommands.cpp b/src/core/editcommands.cpp index 8259e308..8c2b072a 100644 --- a/src/core/editcommands.cpp +++ b/src/core/editcommands.cpp @@ -498,10 +498,10 @@ ScriptEditMap::ScriptEditMap(Map *map, this->newMetatiles = newMetatiles; this->oldMetatiles = oldMetatiles; - this->oldMapWidth = oldMapWidth; - this->oldMapHeight = oldMapHeight; - this->newMapWidth = newMapWidth; - this->newMapHeight = newMapHeight; + this->oldMapWidth = oldMapDimensions.width(); + this->oldMapHeight = oldMapDimensions.height(); + this->newMapWidth = newMapDimensions.width(); + this->newMapHeight = newMapDimensions.height(); } ScriptEditMap::~ScriptEditMap() { @@ -517,7 +517,7 @@ void ScriptEditMap::redo() { if (map->layout->blockdata) { map->layout->blockdata->copyFrom(newMetatiles); if (newMapWidth != map->getWidth() || newMapHeight != map->getHeight()) { - map->setDimensions(newMapWidth, newMapHeight); + map->setDimensions(newMapWidth, newMapHeight, false); } } @@ -533,7 +533,7 @@ void ScriptEditMap::undo() { if (map->layout->blockdata) { map->layout->blockdata->copyFrom(oldMetatiles); if (oldMapWidth != map->getWidth() || oldMapHeight != map->getHeight()) { - map->setDimensions(oldMapWidth, oldMapHeight); + map->setDimensions(oldMapWidth, oldMapHeight, false); } }