GUI: fix adding orders

This commit is contained in:
tildearrow 2023-03-09 00:36:18 -05:00
parent 9fc3a8afed
commit c90152b425
2 changed files with 3 additions and 1 deletions

View file

@ -3625,7 +3625,8 @@ void DivEngine::addOrder(int pos, bool duplicate, bool where) {
} }
curSubSong->ordersLen++; curSubSong->ordersLen++;
saveLock.unlock(); saveLock.unlock();
if (pos<=curOrder) curOrder++; curOrder=pos+1;
prevOrder=curOrder;
if (playing && !freelance) { if (playing && !freelance) {
playSub(false); playSub(false);
} }

View file

@ -1472,6 +1472,7 @@ void FurnaceGUI::doAction(int what) {
case GUI_ACTION_ORDERS_ADD: case GUI_ACTION_ORDERS_ADD:
prepareUndo(GUI_UNDO_CHANGE_ORDER); prepareUndo(GUI_UNDO_CHANGE_ORDER);
e->addOrder(curOrder,false,false); e->addOrder(curOrder,false,false);
curOrder=e->getOrder();
makeUndo(GUI_UNDO_CHANGE_ORDER); makeUndo(GUI_UNDO_CHANGE_ORDER);
break; break;
case GUI_ACTION_ORDERS_DUPLICATE: case GUI_ACTION_ORDERS_DUPLICATE: