@@ -1119,15 +1119,17 @@ void BuyMenuGUI::Update() {
1119
1119
if (pressDown && m_DraggedItemIndex < listSize - 1 ) {
1120
1120
m_IsDragging = true ;
1121
1121
std::swap ((*m_pShopList->GetItemList ())[m_DraggedItemIndex], (*m_pShopList->GetItemList ())[m_DraggedItemIndex + 1 ]);
1122
- std::swap ((*m_pShopList->GetItemList ())[m_DraggedItemIndex + 1 ]->m_ID , (*m_pShopList->GetItemList ())[m_DraggedItemIndex]->m_ID );
1122
+ std::swap ((*m_pShopList->GetItemList ())[m_DraggedItemIndex]->m_ID , (*m_pShopList->GetItemList ())[m_DraggedItemIndex + 1 ]->m_ID );
1123
+ std::swap (m_Loadouts[m_DraggedItemIndex], m_Loadouts[m_DraggedItemIndex + 1 ]);
1123
1124
m_ListItemIndex = ++m_DraggedItemIndex;
1124
1125
m_SelectedLoadoutIndex = -1 ;
1125
1126
m_pShopList->SetSelectedIndex (m_ListItemIndex);
1126
1127
g_GUISound.SelectionChangeSound ()->Play (m_pController->GetPlayer ());
1127
1128
} else if (pressUp && m_DraggedItemIndex > 0 ) {
1128
1129
m_IsDragging = true ;
1129
1130
std::swap ((*m_pShopList->GetItemList ())[m_DraggedItemIndex], (*m_pShopList->GetItemList ())[m_DraggedItemIndex - 1 ]);
1130
- std::swap ((*m_pShopList->GetItemList ())[m_DraggedItemIndex - 1 ]->m_ID , (*m_pShopList->GetItemList ())[m_DraggedItemIndex]->m_ID );
1131
+ std::swap ((*m_pShopList->GetItemList ())[m_DraggedItemIndex]->m_ID , (*m_pShopList->GetItemList ())[m_DraggedItemIndex - 1 ]->m_ID );
1132
+ std::swap (m_Loadouts[m_DraggedItemIndex], m_Loadouts[m_DraggedItemIndex - 1 ]);
1131
1133
m_ListItemIndex = --m_DraggedItemIndex;
1132
1134
m_SelectedLoadoutIndex = -1 ;
1133
1135
m_pShopList->SetSelectedIndex (m_ListItemIndex);
@@ -1373,15 +1375,15 @@ void BuyMenuGUI::Update() {
1373
1375
m_IsDragging = true ;
1374
1376
itemsChanged = true ;
1375
1377
std::swap ((*m_pCartList->GetItemList ())[m_DraggedItemIndex], (*m_pCartList->GetItemList ())[m_DraggedItemIndex + 1 ]);
1376
- std::swap ((*m_pCartList->GetItemList ())[m_DraggedItemIndex + 1 ]->m_ID , (*m_pCartList->GetItemList ())[m_DraggedItemIndex]->m_ID );
1378
+ std::swap ((*m_pCartList->GetItemList ())[m_DraggedItemIndex]->m_ID , (*m_pCartList->GetItemList ())[m_DraggedItemIndex + 1 ]->m_ID );
1377
1379
m_ListItemIndex = ++m_DraggedItemIndex;
1378
1380
m_pCartList->SetSelectedIndex (m_ListItemIndex);
1379
1381
g_GUISound.SelectionChangeSound ()->Play (m_pController->GetPlayer ());
1380
1382
} else if (pressUp && m_DraggedItemIndex > 0 ) {
1381
1383
m_IsDragging = true ;
1382
1384
itemsChanged = true ;
1383
1385
std::swap ((*m_pCartList->GetItemList ())[m_DraggedItemIndex], (*m_pCartList->GetItemList ())[m_DraggedItemIndex - 1 ]);
1384
- std::swap ((*m_pCartList->GetItemList ())[m_DraggedItemIndex - 1 ]->m_ID , (*m_pCartList->GetItemList ())[m_DraggedItemIndex]->m_ID );
1386
+ std::swap ((*m_pCartList->GetItemList ())[m_DraggedItemIndex]->m_ID , (*m_pCartList->GetItemList ())[m_DraggedItemIndex + 1 ]->m_ID );
1385
1387
m_ListItemIndex = --m_DraggedItemIndex;
1386
1388
m_pCartList->SetSelectedIndex (m_ListItemIndex);
1387
1389
g_GUISound.SelectionChangeSound ()->Play (m_pController->GetPlayer ());
@@ -1748,7 +1750,8 @@ void BuyMenuGUI::Update() {
1748
1750
m_DraggedItemIndex = oldIndex + direction;
1749
1751
m_SelectedLoadoutIndex = m_DraggedItemIndex;
1750
1752
std::swap ((*m_pShopList->GetItemList ())[oldIndex], (*m_pShopList->GetItemList ())[oldIndex + direction]);
1751
- std::swap ((*m_pShopList->GetItemList ())[oldIndex + direction]->m_ID , (*m_pShopList->GetItemList ())[oldIndex]->m_ID );
1753
+ std::swap ((*m_pShopList->GetItemList ())[oldIndex]->m_ID , (*m_pShopList->GetItemList ())[oldIndex + direction]->m_ID );
1754
+ std::swap (m_Loadouts[oldIndex], m_Loadouts[oldIndex + direction]);
1752
1755
}
1753
1756
}
1754
1757
@@ -1853,7 +1856,7 @@ void BuyMenuGUI::Update() {
1853
1856
1854
1857
m_DraggedItemIndex = oldIndex + direction;
1855
1858
std::swap ((*m_pCartList->GetItemList ())[oldIndex], (*m_pCartList->GetItemList ())[oldIndex + direction]);
1856
- std::swap ((*m_pCartList->GetItemList ())[oldIndex + direction ]->m_ID , (*m_pCartList->GetItemList ())[oldIndex]->m_ID );
1859
+ std::swap ((*m_pCartList->GetItemList ())[oldIndex]->m_ID , (*m_pCartList->GetItemList ())[oldIndex + direction ]->m_ID );
1857
1860
}
1858
1861
UpdateItemNestingLevels ();
1859
1862
}
0 commit comments