mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Fix crash when dragging card list past end.
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1431 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -103,6 +103,7 @@ void CardListBase::onAction(const Action& action, bool undone) {
|
||||
}
|
||||
TYPE_CASE(action, ReorderCardsAction) {
|
||||
if (sort_by_column >= 0) return; // nothing changes for us
|
||||
if ((long)action.card_id1 < 0 || (long)action.card_id2 >= sorted_list.size()) return;
|
||||
if ((long)action.card_id1 == selected_item_pos || (long)action.card_id2 == selected_item_pos) {
|
||||
// Selected card has moved; also move in the sorted card list
|
||||
swap(sorted_list[action.card_id1], sorted_list[action.card_id2]);
|
||||
|
||||
Reference in New Issue
Block a user