mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-28 17:39:42 +00:00
Feat(CS): Create LAND record using the undo stack
This commit is contained in:
parent
731302ecff
commit
d8187e40b2
1 changed files with 10 additions and 3 deletions
|
@ -25,6 +25,7 @@
|
||||||
#include "cellwater.hpp"
|
#include "cellwater.hpp"
|
||||||
#include "instancedragmodes.hpp"
|
#include "instancedragmodes.hpp"
|
||||||
#include "mask.hpp"
|
#include "mask.hpp"
|
||||||
|
#include "model/world/commands.hpp"
|
||||||
#include "object.hpp"
|
#include "object.hpp"
|
||||||
#include "pathgrid.hpp"
|
#include "pathgrid.hpp"
|
||||||
#include "terrainstorage.hpp"
|
#include "terrainstorage.hpp"
|
||||||
|
@ -131,11 +132,17 @@ void CSVRender::Cell::updateLand()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Setup land if available
|
CSMWorld::IdCollection<CSMWorld::Land>& land = mData.getLand();
|
||||||
const CSMWorld::IdCollection<CSMWorld::Land>& land = mData.getLand();
|
|
||||||
int landIndex = land.searchId(mId);
|
int landIndex = land.searchId(mId);
|
||||||
|
|
||||||
if (landIndex == -1 || land.getRecord(mId).isDeleted())
|
if (landIndex == -1)
|
||||||
|
{
|
||||||
|
CSMWorld::IdTable& landTable
|
||||||
|
= dynamic_cast<CSMWorld::IdTable&>(*mData.getTableModel(CSMWorld::UniversalId::Type_Land));
|
||||||
|
mUndoStack.push(new CSMWorld::CreateCommand(landTable, mId.getRefIdString()));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (land.getRecord(mId).isDeleted())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const ESM::Land& esmLand = land.getRecord(mId).get();
|
const ESM::Land& esmLand = land.getRecord(mId).get();
|
||||||
|
|
Loading…
Reference in a new issue