mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-19 22:53:53 +00:00
Fix handling of deleted pathgrids.
This commit is contained in:
parent
bded4f86f0
commit
90620081c7
1 changed files with 27 additions and 3 deletions
|
@ -277,8 +277,31 @@ namespace CSVRender
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CSMWorld::CreatePathgridCommand* createCmd = new CSMWorld::CreatePathgridCommand(*model, mId);
|
int index = mPathgridCollection.searchId(mId);
|
||||||
commands.push(createCmd);
|
if (index == -1)
|
||||||
|
{
|
||||||
|
// Does not exist
|
||||||
|
commands.push(new CSMWorld::CreatePathgridCommand(*model, mId));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
source = &mPathgridCollection.getRecord(index).get();
|
||||||
|
|
||||||
|
// Deleted, so revert and remove all data
|
||||||
|
commands.push(new CSMWorld::RevertCommand(*model, mId));
|
||||||
|
|
||||||
|
int parentColumn = mPathgridCollection.findColumnIndex(CSMWorld::Columns::ColumnId_PathgridPoints);
|
||||||
|
for (int row = source->mPoints.size() - 1; row >= 0; --row)
|
||||||
|
{
|
||||||
|
commands.push(new CSMWorld::DeleteNestedCommand(*model, mId, row, parentColumn));
|
||||||
|
}
|
||||||
|
|
||||||
|
parentColumn = mPathgridCollection.findColumnIndex(CSMWorld::Columns::ColumnId_PathgridEdges);
|
||||||
|
for (int row = source->mEdges.size() - 1; row >= 0; --row)
|
||||||
|
{
|
||||||
|
commands.push(new CSMWorld::DeleteNestedCommand(*model, mId, row, parentColumn));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -510,7 +533,8 @@ namespace CSVRender
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
removeGeometry();
|
removePathgridGeometry();
|
||||||
|
removeSelectedGeometry();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue