mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
added 'undone' parameter to onAction
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@43 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -39,12 +39,10 @@ void AddCardAction::perform(bool to_undo) {
|
||||
|
||||
RemoveCardAction::RemoveCardAction(Set& set, const CardP& card)
|
||||
: CardListAction(set), card(card)
|
||||
{
|
||||
// find the card_id of the card we want to remove
|
||||
vector<CardP>::iterator it = find(set.cards.begin(), set.cards.end(), card);
|
||||
if (it != set.cards.end()) {
|
||||
card_id = it - set.cards.begin();
|
||||
} else {
|
||||
, card_id(find(set.cards.begin(), set.cards.end(), card) - set.cards.begin())
|
||||
{
|
||||
if (card_id >= set.cards.size()) {
|
||||
throw InternalError(_("Card to remove not found in set"));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user