diff --git a/apps/opencs/model/world/commands.cpp b/apps/opencs/model/world/commands.cpp index 602d32f0f..5f9422376 100644 --- a/apps/opencs/model/world/commands.cpp +++ b/apps/opencs/model/world/commands.cpp @@ -8,6 +8,7 @@ #include #include +#include "cellcoordinates.hpp" #include "idcollection.hpp" #include "idtable.hpp" #include "idtree.hpp" @@ -251,17 +252,11 @@ void CSMWorld::CreatePathgridCommand::redo() record.get().blank(); record.get().mCell = mId; - if (!mId.empty() && mId[0]=='#') + std::pair coords = CellCoordinates::fromId(mId); + if (coords.second) { - int x, y; - char ignore; - - std::istringstream stream (mId); - if (stream >> ignore >> x >> y) - { - record.get().mData.mX = x; - record.get().mData.mY = y; - } + record.get().mData.mX = coords.first.getX(); + record.get().mData.mY = coords.first.getY(); } mModel.setRecord(mId, record, mType); diff --git a/apps/opencs/view/render/pathgridmode.cpp b/apps/opencs/view/render/pathgridmode.cpp index 423497a24..a4ab39497 100644 --- a/apps/opencs/view/render/pathgridmode.cpp +++ b/apps/opencs/view/render/pathgridmode.cpp @@ -60,7 +60,7 @@ namespace CSVRender { // Add node QUndoStack& undoStack = getWorldspaceWidget().getDocument().getUndoStack(); - QString description = "Connect node to selected nodes"; + QString description = "Add node"; CSMWorld::CommandMacro macro(undoStack, description); cell->getPathgrid()->applyPoint(macro, hitResult.worldPos);