Changed so you can't delete last card in set.

(this can cause crashes, and an empty set seems pointless anyways.)


git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@403 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
coppro
2007-05-20 19:39:41 +00:00
parent 7d49be5a3a
commit bd891efc15
+2 -1
View File
@@ -199,7 +199,8 @@ void CardsPanel::onCommand(int id) {
set->actions.add(new AddCardAction(*set));
break;
case ID_CARD_REMOVE:
if (card_list->getCard() != nullptr)
if (card_list->getCard() != nullptr && set->cards.size() != 1)
//Don't delete the last card, and certainly don't delete a card if none exists.
set->actions.add(new RemoveCardAction(*set, card_list->getCard()));
break;
case ID_CARD_ROTATE: