forked from mirror/openmw-tes3mp
prevent deleting already deleted record
This commit is contained in:
parent
ea9b6fa37e
commit
ad2f9a69a1
1 changed files with 7 additions and 1 deletions
|
@ -596,9 +596,15 @@ void CSVWorld::DialogueSubView::revertRecord()
|
|||
void CSVWorld::DialogueSubView::deleteRecord()
|
||||
{
|
||||
int rows = mTable->rowCount();
|
||||
|
||||
//easier than disabling the button
|
||||
CSMWorld::RecordBase::State state = static_cast<CSMWorld::RecordBase::State>(mTable->data (mTable->index (mRow, 1)).toInt());
|
||||
bool deledetedOrErased = (state == CSMWorld::RecordBase::State_Deleted || state == CSMWorld::RecordBase::State_Erased);
|
||||
|
||||
if (!mLocked &&
|
||||
mTable->columnCount() > 0 &&
|
||||
mRow < mTable->rowCount() &&
|
||||
!deledetedOrErased &&
|
||||
mRow < rows &&
|
||||
mBottom->canCreateAndDelete())
|
||||
{
|
||||
mUndoStack.push(new CSMWorld::DeleteCommand(*mTable, mTable->data(mTable->index (mRow, 0)).toString().toStdString()));
|
||||
|
|
Loading…
Reference in a new issue